Compare commits
94 Commits
features/c
...
e1459d85ea
| Author | SHA1 | Date | |
|---|---|---|---|
| e1459d85ea | |||
| 3054930a86 | |||
| f927db064a | |||
| 4397abd041 | |||
| 0589883f8e | |||
| a4b403ca20 | |||
| d73e64dbac | |||
| ff7b88f9f8 | |||
| cf7c3aaeb2 | |||
| 37fdba1d85 | |||
| cd4fcb7aa0 | |||
| f50ed9aa5f | |||
| 1e0cfead5b | |||
| 966fd2ca7a | |||
| 0837d0ce08 | |||
| a10253b2e8 | |||
| b58316bb88 | |||
| 08b68f9e08 | |||
| 209d1cd777 | |||
| be487d6a03 | |||
| 1eb3aeeda0 | |||
| 3be64e7f44 | |||
| 03a661cdc0 | |||
| b3c288628c | |||
| a68ec444cc | |||
| d45e01ac85 | |||
| 58f517bf31 | |||
| 9bb0cc5c75 | |||
| 7f18f22efb | |||
| 3a68fd2ce4 | |||
| af3218412f | |||
| fa7421c35b | |||
| f35670c72e | |||
| 5cb9497163 | |||
| a77c0e854d | |||
| 15cac660bc | |||
| e75eff4e20 | |||
| 0feec2982f | |||
| 40d078c653 | |||
| b5ab0772a0 | |||
| 31dd11d017 | |||
| f293f65650 | |||
| 6dfd12fae8 | |||
| cfd1104c28 | |||
| a4ad0a4556 | |||
| 7d64390bae | |||
| 411a6c0c2d | |||
| 4876d8ab14 | |||
| bed73b2b16 | |||
| 2bfb298054 | |||
| 5a0814a0ba | |||
| 54ef33d1ab | |||
| 126254ea94 | |||
| 3fd779854f | |||
| f9e4681af4 | |||
| de2928414b | |||
| 84089d3639 | |||
| 9d6d278d78 | |||
| 02b0a937b4 | |||
| c8b0457195 | |||
| c0096457fb | |||
| b6062ba4d1 | |||
| 8dc8c974d3 | |||
| 9cc74a9a38 | |||
| 957416df9e | |||
| 8e6168d4ee | |||
| 8d8af75108 | |||
| c1a8ce86a6 | |||
| 555f13508e | |||
| 14feb49dcd | |||
| d92a2b2503 | |||
| 39de1c48c0 | |||
| 5ccfdb6a3f | |||
| f9e2b32118 | |||
| 87b3bfbe83 | |||
| 3ebb1cf165 | |||
| 62f25ea726 | |||
| c84176b8d3 | |||
| 6125fcbd0b | |||
| 61f4dd513f | |||
| 211af6103a | |||
| 5e9f437497 | |||
| d27b622db8 | |||
| 69af57f876 | |||
| c80b40082c | |||
| 56f78e77f3 | |||
| 4a88af6487 | |||
| 0c7dc082fd | |||
| 966b0af1c2 | |||
| 3f5d7e980c | |||
| 58aa088ac3 | |||
| 87be4e4483 | |||
| 033b430051 | |||
| b8dbc7f625 |
@@ -52,10 +52,8 @@ jobs:
|
|||||||
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
# 4) Checkout du dépôt
|
# 4) Checkout du dépôt
|
||||||
#- name: Checkout repository
|
|
||||||
# uses: https://gitea.com/actions/checkout@v4 #actions/checkout@v4
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }} .
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 5) Informations de contexte (sans secrets)
|
# 5) Informations de contexte (sans secrets)
|
||||||
- name: Show context information
|
- name: Show context information
|
||||||
|
|||||||
@@ -52,10 +52,8 @@ jobs:
|
|||||||
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
# 4) Checkout du dépôt
|
# 4) Checkout du dépôt
|
||||||
#- name: Checkout repository
|
|
||||||
# uses: https://gitea.com/actions/checkout@v4 #actions/checkout@v4
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: git clone ${{ gitea.server_url }}/${{ gitea.repository }} .
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# 5) Création des secrets runtime (CI uniquement)
|
# 5) Création des secrets runtime (CI uniquement)
|
||||||
- name: Create runtime secrets
|
- name: Create runtime secrets
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,4 +5,3 @@ target/*
|
|||||||
ansible
|
ansible
|
||||||
secrets/
|
secrets/
|
||||||
.env
|
.env
|
||||||
/uploads/
|
|
||||||
|
|||||||
14
pom.xml
14
pom.xml
@@ -73,7 +73,6 @@
|
|||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.jasperreports</groupId>
|
<groupId>net.sf.jasperreports</groupId>
|
||||||
<artifactId>jasperreports</artifactId>
|
<artifactId>jasperreports</artifactId>
|
||||||
@@ -156,18 +155,7 @@
|
|||||||
<version>1.7.6</version>
|
<version>1.7.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
|
||||||
<artifactId>httpclient5</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
||||||
<artifactId>jackson-datatype-jdk8</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
package io.gmss.fiscad.configuration;
|
package io.gmss.fiscad.configuration;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
||||||
import io.gmss.fiscad.security.CustomUserDetailsService;
|
import io.gmss.fiscad.security.CustomUserDetailsService;
|
||||||
import io.gmss.fiscad.security.JwtAuthenticationFilter;
|
import io.gmss.fiscad.security.JwtAuthenticationFilter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.modelmapper.ModelMapper;
|
import org.modelmapper.ModelMapper;
|
||||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
@@ -67,7 +63,4 @@ public class ApplicationConfig {
|
|||||||
|
|
||||||
return authenticationManagerBuilder.build();
|
return authenticationManagerBuilder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
package io.gmss.fiscad.configuration;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
||||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class RestTemplateConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public ObjectMapper objectMapper() {
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
|
||||||
mapper.registerModule(new JavaTimeModule());
|
|
||||||
mapper.registerModule(new Jdk8Module());
|
|
||||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
|
||||||
return mapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
|
|
||||||
return builder -> {
|
|
||||||
builder.modules(new JavaTimeModule(), new Jdk8Module());
|
|
||||||
builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public RestTemplate restTemplate(ObjectMapper mapper) {
|
|
||||||
|
|
||||||
mapper.registerModule(new JavaTimeModule());
|
|
||||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
|
||||||
|
|
||||||
MappingJackson2HttpMessageConverter converter =
|
|
||||||
new MappingJackson2HttpMessageConverter(mapper);
|
|
||||||
|
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
|
||||||
restTemplate.getMessageConverters().removeIf(
|
|
||||||
c -> c instanceof MappingJackson2HttpMessageConverter
|
|
||||||
);
|
|
||||||
restTemplate.getMessageConverters().add(converter);
|
|
||||||
|
|
||||||
return restTemplate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
//package io.gmss.fiscad.configuration;
|
|
||||||
//
|
|
||||||
//import com.backend.api.security.CustomUserDetailsService;
|
|
||||||
//import com.backend.api.security.JwtAuthenticationEntryPoint;
|
|
||||||
//import com.backend.api.security.JwtAuthenticationFilter;
|
|
||||||
//import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
//import org.springframework.context.annotation.Bean;
|
|
||||||
//import org.springframework.context.annotation.Configuration;
|
|
||||||
//import org.springframework.http.HttpMethod;
|
|
||||||
//import org.springframework.security.authentication.AuthenticationManager;
|
|
||||||
//import org.springframework.security.config.BeanIds;
|
|
||||||
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
|
||||||
//import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
|
||||||
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
||||||
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
||||||
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
||||||
//import org.springframework.security.config.http.SessionCreationPolicy;
|
|
||||||
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
||||||
//import org.springframework.security.crypto.password.PasswordEncoder;
|
|
||||||
//import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
|
||||||
//
|
|
||||||
//@Configuration
|
|
||||||
//@EnableWebSecurity // active la sécurité web sur le projet
|
|
||||||
//@EnableGlobalMethodSecurity( // est utilisé pour définir la sécurité sur les méthodes
|
|
||||||
// securedEnabled = true, // est activé pour protéger un controlleur ou un service
|
|
||||||
// jsr250Enabled = true, // active le role qui doit être utilisé
|
|
||||||
// prePostEnabled = true // active le controle avant et après l'execution de la requête
|
|
||||||
//)
|
|
||||||
//public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Est utilisé pour authentifier un utlisateur ou pour définir un role
|
|
||||||
// */
|
|
||||||
// @Autowired
|
|
||||||
// CustomUserDetailsService customUserDetailsService;
|
|
||||||
//
|
|
||||||
// @Autowired
|
|
||||||
// private JwtAuthenticationEntryPoint unauthorizedHandler;
|
|
||||||
//
|
|
||||||
// @Bean
|
|
||||||
// public JwtAuthenticationFilter jwtAuthenticationFilter() {
|
|
||||||
// return new JwtAuthenticationFilter();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private static final String[] AUTH_WHITELIST = {
|
|
||||||
//
|
|
||||||
// // -- swagger ui
|
|
||||||
// "/swagger-resources/**",
|
|
||||||
// "/swagger-ui.html",
|
|
||||||
// "/v3/api-docs",
|
|
||||||
// "/swagger-ui/**",
|
|
||||||
// "/webjars/**",
|
|
||||||
// "/api/**",
|
|
||||||
//// "/api/synonym/**",
|
|
||||||
// "/api/auth/**"
|
|
||||||
// };
|
|
||||||
// @Override
|
|
||||||
// public void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
|
|
||||||
// authenticationManagerBuilder
|
|
||||||
// .userDetailsService(customUserDetailsService)
|
|
||||||
// .passwordEncoder(passwordEncoder());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Bean(BeanIds.AUTHENTICATION_MANAGER)
|
|
||||||
// @Override
|
|
||||||
// public AuthenticationManager authenticationManagerBean() throws Exception {
|
|
||||||
// return super.authenticationManagerBean();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Bean
|
|
||||||
// public PasswordEncoder passwordEncoder() {
|
|
||||||
// return new BCryptPasswordEncoder();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// *
|
|
||||||
// * @param http
|
|
||||||
// * @throws Exception
|
|
||||||
// */
|
|
||||||
// @Override
|
|
||||||
// protected void configure(HttpSecurity http) throws Exception {
|
|
||||||
// http
|
|
||||||
// .cors()
|
|
||||||
// .and()
|
|
||||||
// .csrf()
|
|
||||||
// .disable()
|
|
||||||
// .exceptionHandling()
|
|
||||||
// .authenticationEntryPoint(unauthorizedHandler)
|
|
||||||
// .and()
|
|
||||||
// .sessionManagement()
|
|
||||||
// .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
|
||||||
// .and()
|
|
||||||
// .authorizeRequests()
|
|
||||||
// .antMatchers("/",
|
|
||||||
// "/favicon.ico",
|
|
||||||
// "/**/*.png",
|
|
||||||
// "/**/*.gif",
|
|
||||||
// "/**/*.svg",
|
|
||||||
// "/**/*.jpg",
|
|
||||||
// "/**/*.html",
|
|
||||||
// "/**/*.css",
|
|
||||||
// "/**/*.js")
|
|
||||||
// .permitAll()
|
|
||||||
// .antMatchers(AUTH_WHITELIST).permitAll()
|
|
||||||
// .antMatchers("/api/auth/**")
|
|
||||||
// .permitAll()
|
|
||||||
// .antMatchers("/api/user/checkUsernameAvailability", "/api/user/checkEmailAvailability")
|
|
||||||
// .permitAll()
|
|
||||||
// .antMatchers(HttpMethod.GET, "/api/polls/**", "/api/users/**")
|
|
||||||
// .permitAll()
|
|
||||||
// .anyRequest()
|
|
||||||
// .authenticated();
|
|
||||||
//
|
|
||||||
// // Add our custom JWT security filter
|
|
||||||
// http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -1,113 +1,11 @@
|
|||||||
package io.gmss.fiscad.configuration;
|
package io.gmss.fiscad.configuration;
|
||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.security.JwtAuthenticationEntryPoint;
|
import io.gmss.fiscad.security.JwtAuthenticationEntryPoint;
|
||||||
import io.gmss.fiscad.security.JwtAuthenticationFilter;
|
import io.gmss.fiscad.security.JwtAuthenticationFilter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.security.authentication.AuthenticationProvider;
|
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
|
||||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
|
||||||
import org.springframework.security.web.SecurityFilterChain;
|
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
|
||||||
import org.springframework.web.cors.CorsConfigurationSource;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@EnableWebSecurity
|
|
||||||
@Configuration
|
|
||||||
@EnableMethodSecurity(securedEnabled = true, jsr250Enabled = true, prePostEnabled = true)
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class SpringSecurityConfig {
|
|
||||||
|
|
||||||
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
|
|
||||||
private final AuthenticationProvider authenticationProvider;
|
|
||||||
private final JwtAuthenticationFilter jwtAuthenticationFilter;
|
|
||||||
|
|
||||||
private static final String[] PUBLIC_ENDPOINTS = {
|
|
||||||
"/api/auth/login",
|
|
||||||
"/api/open/**",
|
|
||||||
"/api/synchronisation/references",
|
|
||||||
"/v3/api-docs/**",
|
|
||||||
"/swagger-ui/**",
|
|
||||||
"/swagger-ui.html",
|
|
||||||
"/error",
|
|
||||||
"/api/**" // A ENLEVER AVANT LA MISE EN PRODUCTION
|
|
||||||
};
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
|
||||||
|
|
||||||
http
|
|
||||||
// Désactivation CSRF car JWT stateless
|
|
||||||
.csrf(AbstractHttpConfigurer::disable)
|
|
||||||
|
|
||||||
// CORS configuration propre
|
|
||||||
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
|
|
||||||
|
|
||||||
// Gestion des exceptions d’authentification
|
|
||||||
.exceptionHandling(exception ->
|
|
||||||
exception.authenticationEntryPoint(jwtAuthenticationEntryPoint)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Stateless session
|
|
||||||
.sessionManagement(session ->
|
|
||||||
session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Configuration des autorisations
|
|
||||||
.authorizeHttpRequests(auth -> auth
|
|
||||||
// Autoriser les requêtes OPTIONS (CORS preflight)
|
|
||||||
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
|
||||||
|
|
||||||
// Endpoints publics
|
|
||||||
.requestMatchers(PUBLIC_ENDPOINTS).permitAll()
|
|
||||||
|
|
||||||
// Tout le reste nécessite authentification
|
|
||||||
.anyRequest().authenticated()
|
|
||||||
)
|
|
||||||
|
|
||||||
// Provider d’authentification
|
|
||||||
.authenticationProvider(authenticationProvider)
|
|
||||||
|
|
||||||
// Ajout du filtre JWT avant UsernamePasswordAuthenticationFilter
|
|
||||||
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
|
||||||
|
|
||||||
return http.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration CORS centralisée.
|
|
||||||
* ⚠️ En production, remplacer "*" par ton domaine frontend.
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public CorsConfigurationSource corsConfigurationSource() {
|
|
||||||
return request -> {
|
|
||||||
CorsConfiguration configuration = new CorsConfiguration();
|
|
||||||
|
|
||||||
configuration.setAllowedOrigins(List.of("*")); // ⚠️ restreindre en prod
|
|
||||||
configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
|
|
||||||
configuration.setAllowedHeaders(List.of("*"));
|
|
||||||
configuration.setAllowCredentials(false);
|
|
||||||
|
|
||||||
return configuration;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
import io.gmss.fiscad.security.JwtAuthenticationEntryPoint;
|
|
||||||
import io.gmss.fiscad.security.JwtAuthenticationFilter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.security.authentication.AuthenticationProvider;
|
import org.springframework.security.authentication.AuthenticationProvider;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
@@ -129,15 +27,16 @@ public class SpringSecurityConfig {
|
|||||||
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
|
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
|
||||||
private final AuthenticationProvider authenticationProvider;
|
private final AuthenticationProvider authenticationProvider;
|
||||||
private final JwtAuthenticationFilter jwtAuthenticationFilter;
|
private final JwtAuthenticationFilter jwtAuthenticationFilter;
|
||||||
|
|
||||||
|
|
||||||
private static final String[] AUTH_WHITELIST = {
|
private static final String[] AUTH_WHITELIST = {
|
||||||
// "/api/**",
|
"/api/**",
|
||||||
"/api/auth/login",
|
"/api/auth/login",
|
||||||
"/api/open/**",
|
"/api/open/**",
|
||||||
"/api/synchronisation/references",
|
"/api/synchronisation/references",
|
||||||
"/v3/api-docs/**",
|
"/v3/api-docs/**",
|
||||||
"/swagger-ui/**",
|
"/swagger-ui/**",
|
||||||
"/swagger-ui.html",
|
"/swagger-ui.html"
|
||||||
"/error"
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,7 +58,7 @@ public class SpringSecurityConfig {
|
|||||||
.exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint))
|
.exceptionHandling(ex -> ex.authenticationEntryPoint(jwtAuthenticationEntryPoint))
|
||||||
.authorizeHttpRequests(req ->
|
.authorizeHttpRequests(req ->
|
||||||
req
|
req
|
||||||
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
//.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
||||||
.requestMatchers(AUTH_WHITELIST).permitAll()
|
.requestMatchers(AUTH_WHITELIST).permitAll()
|
||||||
.anyRequest()
|
.anyRequest()
|
||||||
.authenticated()
|
.authenticated()
|
||||||
@@ -167,8 +66,11 @@ public class SpringSecurityConfig {
|
|||||||
.authenticationProvider(authenticationProvider)
|
.authenticationProvider(authenticationProvider)
|
||||||
.sessionManagement(session -> session.sessionCreationPolicy(STATELESS))
|
.sessionManagement(session -> session.sessionCreationPolicy(STATELESS))
|
||||||
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
|
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ import io.gmss.fiscad.paylaods.ApiResponse;
|
|||||||
import io.gmss.fiscad.paylaods.request.crudweb.SecteurPaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.SecteurPaylaodWeb;
|
||||||
import io.gmss.fiscad.paylaods.request.synchronisation.SecteurPayload;
|
import io.gmss.fiscad.paylaods.request.synchronisation.SecteurPayload;
|
||||||
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.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;
|
||||||
@@ -25,7 +24,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "api/secteur", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/secteur", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@SecurityRequirement(name = "bearer")
|
//@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Secteur")
|
@Tag(name = "Secteur")
|
||||||
//@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_SUPERVISEUR')")
|
//@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_SUPERVISEUR')")
|
||||||
public class SecteurController {
|
public class SecteurController {
|
||||||
@@ -315,31 +314,5 @@ 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ import io.gmss.fiscad.interfaces.decoupage.SectionService;
|
|||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.SectionPaylaodWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.SectionPaylaodWeb;
|
||||||
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.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;
|
||||||
@@ -22,7 +21,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "api/section", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/section", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@SecurityRequirement(name = "bearer")
|
//@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Section")
|
@Tag(name = "Section")
|
||||||
//@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_SUPERVISEUR')")
|
//@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_SUPERVISEUR')")
|
||||||
public class SectionController {
|
public class SectionController {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ 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;
|
||||||
@@ -11,8 +10,6 @@ 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;
|
||||||
@@ -51,9 +48,9 @@ public class EnqueteController {
|
|||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createEnquete(@RequestBody @Valid @Validated EnquetePayLoadWeb enquetePayLoadWeb) {
|
public ResponseEntity<?> createEnquete(@RequestBody @Valid @Validated EnquetePayLoadWeb enquetePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
enquetePayLoadWeb = enqueteService.createEnquete(enquetePayLoadWeb);
|
Enquete enquete = enqueteService.createEnquete(enquetePayLoadWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, enquetePayLoadWeb, "Enquete batiment créé avec succès."),
|
new ApiResponse<>(true, enquete, "Enquete batiment créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -215,8 +212,8 @@ public class EnqueteController {
|
|||||||
summary = "Récupérer les enquetes d'une parcelle",
|
summary = "Récupérer les enquetes d'une parcelle",
|
||||||
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
||||||
)
|
)
|
||||||
@GetMapping("/by-parcelle-id/{parcelleId}")
|
@GetMapping("/all/by-parcelle-id/{parcelleId}")
|
||||||
public ResponseEntity<?> getAllByParcelle(@PathVariable Long parcelleId) {
|
public ResponseEntity<?> getAllByEnqueteDecoupageAdmin(@PathVariable Long parcelleId) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, enqueteService.getEnqueteListByParcelle(parcelleId), "Liste des enquetes chargée avec succès."),
|
new ApiResponse<>(true, enqueteService.getEnqueteListByParcelle(parcelleId), "Liste des enquetes chargée avec succès."),
|
||||||
@@ -239,36 +236,6 @@ public class EnqueteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "Récupérer les enquetes d'une parcelle",
|
|
||||||
description = "Permet de récuperer les enquêtes déjà réalisées sur une parcelles"
|
|
||||||
)
|
|
||||||
@GetMapping("/page/by-parcelle-id/{parcelleId}")
|
|
||||||
public ResponseEntity<?> getAllByParcellePaged(@PathVariable Long parcelleId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, enqueteService.getEnqueteListByParcellePageable(parcelleId,pageable), "Liste des enquetes 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("/all/dgi/decoupage-admin-for-enquete")
|
@GetMapping("/all/dgi/decoupage-admin-for-enquete")
|
||||||
@@ -483,8 +450,5 @@ public class EnqueteController {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ 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.metier.ParcelleService;
|
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.FiltreParcelle;
|
|
||||||
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.paylaods.request.crudweb.EnquetePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
|
||||||
@@ -31,7 +30,7 @@ import java.util.List;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "api/parcelle", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/parcelle", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
//@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Parcelle")
|
@Tag(name = "Parcelle")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
@@ -51,9 +50,9 @@ public class ParcelleController {
|
|||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) {
|
public ResponseEntity<?> createParcelle(@RequestBody @Valid @Validated ParcellePayLoadWeb parcellePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
parcellePayLoadWeb = parcelleService.createParcelle(parcellePayLoadWeb);
|
Parcelle parcelle = parcelleService.createParcelle(parcellePayLoadWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, parcellePayLoadWeb, "parcelle créée avec succès."),
|
new ApiResponse<>(true, parcelle, "parcelle créée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -91,7 +90,6 @@ public class ParcelleController {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
@@ -232,39 +230,6 @@ public class ParcelleController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/all-paged/multi-criteres")
|
|
||||||
public ResponseEntity<?> getAllParcelleFiltrePaged(@CurrentUser UserPrincipal currentUser, @RequestParam int pageNo, @RequestParam int pageSize, @RequestBody FiltreParcelle filtreParcelle) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
if(currentUser==null)
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
Long userId = currentUser.getUser().getId();
|
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, parcelleService.getParcelleByMultiFiltre(userId,filtreParcelle,pageable), "Liste des enquetes 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) {
|
|
||||||
e.printStackTrace();
|
|
||||||
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("/all/by-quartier-id/{quartierId}")
|
@GetMapping("/all/by-quartier-id/{quartierId}")
|
||||||
public ResponseEntity<?> getAllParcelleByQuartier(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId) {
|
public ResponseEntity<?> getAllParcelleByQuartier(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId) {
|
||||||
try {
|
try {
|
||||||
@@ -388,33 +353,6 @@ 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "ParcelleGeometrie")
|
@Tag(name = "ParcelleGeometrie")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class ParcelleGeomController {
|
public class ParcelleGeomController {
|
||||||
|
|
||||||
private final ParcelleGeomService parcelleGeomService;
|
private final ParcelleGeomService parcelleGeomService;
|
||||||
@@ -63,24 +63,6 @@ public class ParcelleGeomController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-quartier-id/{quartierId}")
|
|
||||||
public ResponseEntity<?> getParcellesGeomsByQuartierId(@PathVariable Long quartierId) {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierId(quartierId), "Liste des parcelle chargée avec succès."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page/by-quartier-id/{quartierId}")
|
|
||||||
public ResponseEntity<?> getParcellesGeomsByQuartierIdPaged(@PathVariable Long quartierId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListByQuatierIdPaged(quartierId,pageable), "Liste des parcelle chargée avec succès."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/by-arrondissement/{codeArrondissement}")
|
@GetMapping("/by-arrondissement/{codeArrondissement}")
|
||||||
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
|
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
|
|||||||
@@ -7,17 +7,12 @@ import io.gmss.fiscad.exceptions.*;
|
|||||||
import io.gmss.fiscad.interfaces.infocad.metier.PersonneService;
|
import io.gmss.fiscad.interfaces.infocad.metier.PersonneService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.dto.PersonneCompletDTO;
|
import io.gmss.fiscad.paylaods.dto.PersonneCompletDTO;
|
||||||
import io.gmss.fiscad.paylaods.request.RecherchePersonneResquestBody;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.EnquetePayLoadWeb;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.PersonnePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.PersonnePayLoadWeb;
|
||||||
import io.gmss.fiscad.security.CurrentUser;
|
|
||||||
import io.gmss.fiscad.security.UserPrincipal;
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.data.domain.PageRequest;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -41,9 +36,9 @@ public class PersonneController {
|
|||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createPersonne(@RequestBody @Valid @Validated PersonnePayLoadWeb personnePayLoadWeb) {
|
public ResponseEntity<?> createPersonne(@RequestBody @Valid @Validated PersonnePayLoadWeb personnePayLoadWeb) {
|
||||||
try {
|
try {
|
||||||
personnePayLoadWeb = personneService.createPersonne(personnePayLoadWeb);
|
Personne personne = personneService.createPersonne(personnePayLoadWeb);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, personnePayLoadWeb, "Contribuable créé avec succès."),
|
new ApiResponse<>(true, personne, "Contribuable créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -104,7 +99,7 @@ public class PersonneController {
|
|||||||
@GetMapping("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
public ResponseEntity<?> getPersonneById(@PathVariable Long id) {
|
public ResponseEntity<?> getPersonneById(@PathVariable Long id) {
|
||||||
try{
|
try{
|
||||||
Optional<PersonnePayLoadWeb> optionalPersonne= personneService.getPersonneById(id);
|
Optional<Personne> optionalPersonne= personneService.getPersonneById(id);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, optionalPersonne.orElse(null), "Personne retrouvée avec succès."),
|
new ApiResponse<>(true, optionalPersonne.orElse(null), "Personne retrouvée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
@@ -116,70 +111,4 @@ public class PersonneController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/recherche")
|
|
||||||
public ResponseEntity<?> rechercherPersonne(@RequestBody RecherchePersonneResquestBody recherchePersonneResquestBody ) {
|
|
||||||
try{
|
|
||||||
// personneService.recherchePersonne(recherchePersonneResquestBody);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, personneService.recherchePersonne(recherchePersonneResquestBody), "Personne retrouvée avec succès."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}catch (Exception e){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, e.getMessage()),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/all")
|
|
||||||
public ResponseEntity<?> getAllPersonne() {
|
|
||||||
try {
|
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, personneService.getPersonneList(), "Liste des personnes 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("/all-paged")
|
|
||||||
public ResponseEntity<?> getAllPersonnePaged(@CurrentUser UserPrincipal currentUser,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, personneService.getPersonneList(pageable), "Liste des personnes 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,272 +0,0 @@
|
|||||||
package io.gmss.fiscad.controllers.infocad.metier;
|
|
||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.exceptions.*;
|
|
||||||
import io.gmss.fiscad.interfaces.infocad.metier.PieceService;
|
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.PiecePayLoadWeb;
|
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.data.domain.PageRequest;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping(value = "api/piece", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
@SecurityRequirement(name = "bearer")
|
|
||||||
@Tag(name = "Piece")
|
|
||||||
@CrossOrigin(origins = "*")
|
|
||||||
public class PieceController {
|
|
||||||
|
|
||||||
private final PieceService pieceService;
|
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(PieceController.class);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
public ResponseEntity<?> createPiece(@RequestBody @Valid @Validated PiecePayLoadWeb piecePayLoadWeb) {
|
|
||||||
try {
|
|
||||||
piecePayLoadWeb = pieceService.createPiece(piecePayLoadWeb);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, piecePayLoadWeb, "Piece créé 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
|
||||||
public ResponseEntity<?> updatePiece(@PathVariable Long id, @RequestBody PiecePayLoadWeb piecePayLoadWeb) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.updatePiece(id,piecePayLoadWeb), "Piece mise à jour 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
|
||||||
public ResponseEntity<?> deletePiece(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
pieceService.deletePiece(id);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, "Piece supprimé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("/all")
|
|
||||||
public ResponseEntity<?> getAllPieceList() {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getPieceListToDto(), "Liste des caractéristiques 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("/all-paged")
|
|
||||||
public ResponseEntity<?> getAllPiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getPieceListToDtoPageable(pageable), "Liste des caractéristiques 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("/all/by-enquete-id/{enqueteId}")
|
|
||||||
public ResponseEntity<?> getAllPieceByEnqueteList(@PathVariable Long enqueteId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getAllPieceByEnqueteToDto(enqueteId), "Liste des pieces 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("/all-paged/by-enquete-id/{enqueteId}")
|
|
||||||
public ResponseEntity<?> getAllPieceByParcellePaged(@PathVariable Long enqueteId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getAllPieceByEnqueteToDtoPageable(enqueteId,pageable), "Liste des pieces 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-enquete-batiment-id/{enqueteBatimentId}")
|
|
||||||
public ResponseEntity<?> getAllPieceByEnqueteBatiment(@PathVariable Long enqueteBatimentId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getAllPieceByEnqueteBatimentToDto(enqueteBatimentId), "Liste des pieces 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-enquete-unite-logement-id/{enqueteUniteLogementId}")
|
|
||||||
public ResponseEntity<?> getAllPieceByEnqueteUniteLogement(@PathVariable Long enqueteUniteLogementId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getAllPieceByEnqueteUniteLogementToDto(enqueteUniteLogementId), "Liste des pieces 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("/id/{id}")
|
|
||||||
public ResponseEntity<?> getPieceById(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, pieceService.getPieceByToDto(id), "Piece 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.gmss.fiscad.controllers.infocad.metier;
|
package io.gmss.fiscad.controllers.infocad.metier;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||||
import io.gmss.fiscad.interfaces.infocad.metier.UploadService;
|
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.JobModels;
|
import io.gmss.fiscad.paylaods.JobModels;
|
||||||
import io.gmss.fiscad.proprietes.ZipStorageProperties;
|
import io.gmss.fiscad.proprietes.ZipStorageProperties;
|
||||||
@@ -9,9 +8,6 @@ import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
|
|||||||
import io.gmss.fiscad.service.FileStorageService;
|
import io.gmss.fiscad.service.FileStorageService;
|
||||||
import io.gmss.fiscad.service.StringManager;
|
import io.gmss.fiscad.service.StringManager;
|
||||||
import io.gmss.fiscad.service.ZipAsyncService;
|
import io.gmss.fiscad.service.ZipAsyncService;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
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.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
@@ -49,13 +45,12 @@ import java.util.UUID;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Upload")
|
@Tag(name = "Upload")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class UploadController {
|
public class UploadController {
|
||||||
|
|
||||||
boolean headIsValid = false;
|
boolean headIsValid = false;
|
||||||
private final ZipAsyncService service;
|
private final ZipAsyncService service;
|
||||||
private final ZipStorageProperties props;
|
private final ZipStorageProperties props;
|
||||||
private final UploadService uploadService;
|
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(UploadController.class);
|
private static final Logger logger = LoggerFactory.getLogger(UploadController.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -99,7 +94,7 @@ public class UploadController {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (uploadRepository.findById(id).isPresent()) {
|
if (uploadRepository.findById(id).isPresent()) {
|
||||||
return new ResponseEntity<>(new ApiResponse(true, uploadRepository.findById(id), "File with id {" + id + "} is found."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(true, uploadRepository.getOne(id), "File with id {" + id + "} is found."), HttpStatus.OK);
|
||||||
} else {
|
} else {
|
||||||
return new ResponseEntity<>(new ApiResponse(true, null, "The upload with id {" + id + "} you request for is not found."), HttpStatus.OK);
|
return new ResponseEntity<>(new ApiResponse(true, null, "The upload with id {" + id + "} you request for is not found."), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@@ -144,39 +139,30 @@ public class UploadController {
|
|||||||
.body(resource);
|
.body(resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(
|
@PostMapping("/save")
|
||||||
value = "/save",
|
public ResponseEntity<?> save(@RequestPart(required = true) MultipartFile file, @RequestParam String reference, @RequestParam String description /*, @RequestParam Long idTypeUpload*/) {
|
||||||
consumes = MediaType.MULTIPART_FORM_DATA_VALUE
|
|
||||||
)
|
|
||||||
public ResponseEntity<?> saveFilePieceId(
|
|
||||||
@Parameter(
|
|
||||||
description = "Fichier à uploader",
|
|
||||||
required = true,
|
|
||||||
content = @Content(
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM_VALUE,
|
|
||||||
schema = @Schema(type = "string", format = "binary")
|
|
||||||
)
|
|
||||||
)
|
|
||||||
@RequestPart("file") MultipartFile file,
|
|
||||||
|
|
||||||
@Parameter(description = "ID de la pièce", required = true)
|
|
||||||
@RequestParam("pieceId") Long pieceId
|
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
return ResponseEntity.ok(
|
Upload upload = new Upload();
|
||||||
new ApiResponse(true,
|
String fileName = fileStorageService.storeFile(file);
|
||||||
uploadService.createUpload(file, pieceId),
|
upload.setFileName(fileName);
|
||||||
"File has been created successfully.")
|
upload.setMimeType(file.getContentType());
|
||||||
);
|
upload.setSize(file.getSize());
|
||||||
|
upload.setOriginalFileName(file.getOriginalFilename());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true, uploadRepository.save(upload), "File has been created successfully."), HttpStatus.OK);
|
||||||
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
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.getMessage(), e);
|
logger.error(e.getLocalizedMessage());
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
.body(new ApiResponse(false, null, e.getMessage()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/id/{id}")
|
@DeleteMapping("/delete/id/{id}")
|
||||||
public ResponseEntity<?> delete(@PathVariable Long id) {
|
public ResponseEntity<?> delete(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
@@ -243,20 +229,4 @@ public class UploadController {
|
|||||||
.orElse(ResponseEntity.notFound().build());
|
.orElse(ResponseEntity.notFound().build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(path = "/by-piece/{pieceId}")
|
|
||||||
public ResponseEntity<?> getByPiece(@PathVariable("pieceId") Long pieceId) {
|
|
||||||
try{
|
|
||||||
return new ResponseEntity<>(new ApiResponse(true, uploadService.getAllUploadByPiece(pieceId), "Liste des fichier de la piece"), HttpStatus.OK);
|
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
|
||||||
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Bloc")
|
@Tag(name = "Bloc")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class BlocController {
|
public class BlocController {
|
||||||
|
|
||||||
private final BlocService blocService;
|
private final BlocService blocService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Mode d'acquisition")
|
@Tag(name = "Mode d'acquisition")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class ModeAcquisitionController {
|
public class ModeAcquisitionController {
|
||||||
|
|
||||||
private final ModeAcquisitionService modeAcquisitionService;
|
private final ModeAcquisitionService modeAcquisitionService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Nature domaine")
|
@Tag(name = "Nature domaine")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class NatureDomaineController {
|
public class NatureDomaineController {
|
||||||
|
|
||||||
private final NatureDomaineService natureDomaineService;
|
private final NatureDomaineService natureDomaineService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Position représentation")
|
@Tag(name = "Position représentation")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class PositionRepresentationController {
|
public class PositionRepresentationController {
|
||||||
|
|
||||||
private final PositionRepresentationService positionRepresentationService;
|
private final PositionRepresentationService positionRepresentationService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Profession")
|
@Tag(name = "Profession")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class ProfessionController {
|
public class ProfessionController {
|
||||||
|
|
||||||
private final ProfessionService professionService;
|
private final ProfessionService professionService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Situation géographique")
|
@Tag(name = "Situation géographique")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class SituationGeographiqueController {
|
public class SituationGeographiqueController {
|
||||||
|
|
||||||
private final SituationGeographiqueService situationGeographiqueService;
|
private final SituationGeographiqueService situationGeographiqueService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Situation matrimoniale")
|
@Tag(name = "Situation matrimoniale")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class SituationMatrimonialeController {
|
public class SituationMatrimonialeController {
|
||||||
|
|
||||||
private final SituationMatrimonialeService situationMatrimonialeService;
|
private final SituationMatrimonialeService situationMatrimonialeService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Source de droit")
|
@Tag(name = "Source de droit")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class SourceDroitController {
|
public class SourceDroitController {
|
||||||
|
|
||||||
private final SourceDroitService sourceDroitService;
|
private final SourceDroitService sourceDroitService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Type de contestation")
|
@Tag(name = "Type de contestation")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class TypeContestationController {
|
public class TypeContestationController {
|
||||||
|
|
||||||
private final TypeContestationService typeContestationService;
|
private final TypeContestationService typeContestationService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Type de domaine")
|
@Tag(name = "Type de domaine")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class TypeDomaineController {
|
public class TypeDomaineController {
|
||||||
|
|
||||||
private final TypeDomaineService typeDomaineService;
|
private final TypeDomaineService typeDomaineService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Type de personne")
|
@Tag(name = "Type de personne")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class TypePersonneController {
|
public class TypePersonneController {
|
||||||
|
|
||||||
private final TypePersonneService typePersonneService;
|
private final TypePersonneService typePersonneService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Type de pièce")
|
@Tag(name = "Type de pièce")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class TypePieceController {
|
public class TypePieceController {
|
||||||
|
|
||||||
private final TypePieceService typePieceService;
|
private final TypePieceService typePieceService;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Type de représentation")
|
@Tag(name = "Type de représentation")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
//@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
@PreAuthorize("hasRole('ADMIN') or hasRole('SUPERVISEUR') or hasRole('ENQUETEUR')")
|
||||||
public class TypeRepresentationController {
|
public class TypeRepresentationController {
|
||||||
|
|
||||||
private final TypeRepresentationService typeRepresentationService;
|
private final TypeRepresentationService typeRepresentationService;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
|||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueBatimentPayloadWeb;
|
|
||||||
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;
|
||||||
@@ -22,7 +21,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "api/caracteristique-batiment", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/caracteristique-caracteristiqueBatiment", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Caractéristique batiment")
|
@Tag(name = "Caractéristique batiment")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
@@ -36,25 +35,34 @@ public class CaracteristiqueBatimentController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createCaracteristiqueBatiment(@RequestBody @Valid @Validated CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
|
public ResponseEntity<?> createCaracteristiqueBatiment(@RequestBody @Valid @Validated CaracteristiqueBatiment caracteristiqueBatiment) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueBatimentPayloadWeb = caracteristiqueBatimentService.createCaracteristiqueBatiment(caracteristiqueBatimentPayloadWeb);
|
caracteristiqueBatiment = caracteristiqueBatimentService.createCaracteristiqueBatiment(caracteristiqueBatiment);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueBatimentPayloadWeb, "Caracteristique du batiment créé avec succès."),
|
new ApiResponse<>(true, caracteristiqueBatiment, "Caracteristique du batiment créé avec succès."),
|
||||||
HttpStatus.OK
|
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) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
|
||||||
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("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateCaracteristiqueBatiment(@PathVariable Long id, @RequestBody CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) {
|
public ResponseEntity<?> updateCaracteristiqueBatiment(@PathVariable Long id, @RequestBody CaracteristiqueBatiment caracteristiqueBatiment) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueBatimentService.updateCaracteristiqueBatiment(id, caracteristiqueBatimentPayloadWeb), "Caracteristique du batiment mise à jour avec succès."),
|
new ApiResponse<>(true, caracteristiqueBatimentService.updateCaracteristiqueBatiment(id, caracteristiqueBatiment), "Caracteristique du batiment mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -148,7 +156,7 @@ public class CaracteristiqueBatimentController {
|
|||||||
public ResponseEntity<?> getCaracteristiqueBatimentById(@PathVariable Long id) {
|
public ResponseEntity<?> getCaracteristiqueBatimentById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentToDto(id), "Caracteristique du batiment trouvée avec succès."),
|
new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentById(id), "Caracteristique du batiment trouvée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -166,51 +174,4 @@ public class CaracteristiqueBatimentController {
|
|||||||
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-enquete-batiment-id/{enqueteBatimentId}")
|
|
||||||
public ResponseEntity<?> getCaracteristiqueBatimentByBatimentId(@PathVariable Long enqueteBatimentId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentListByEnqueteBatiment(enqueteBatimentId), "Caracteristique du batiment 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page/by-enquete-batiment-id/{enqueteBatimentId}")
|
|
||||||
public ResponseEntity<?> getCaracteristiqueBatimentByEnqueteBatimentIdPaged(@PathVariable Long enqueteBatimentId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, caracteristiqueBatimentService.getCaracteristiqueBatimentListByEnqueteBatimentPageable(enqueteBatimentId,pageable), "Caracteristique du batiment 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
|||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueParcelleService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueParcelleService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueParcellePayloadWeb;
|
|
||||||
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;
|
||||||
@@ -36,11 +35,11 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createCaracteristiqueParcelle(@RequestBody @Valid @Validated CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
|
public ResponseEntity<?> createCaracteristiqueParcelle(@RequestBody @Valid @Validated CaracteristiqueParcelle caracteristiqueParcelle) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueParcellePayloadWeb = caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcellePayloadWeb);
|
caracteristiqueParcelle = caracteristiqueParcelleService.createCaracteristiqueParcelle(caracteristiqueParcelle);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueParcellePayloadWeb, "Caracteristique parcelle créé avec succès."),
|
new ApiResponse<>(true, caracteristiqueParcelle, "Caracteristique parcelle créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -60,10 +59,10 @@ public class CaracteristiqueParcelleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateCaracteristiqueParcelle(@PathVariable Long id, @RequestBody CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) {
|
public ResponseEntity<?> updateCaracteristiqueParcelle(@PathVariable Long id, @RequestBody CaracteristiqueParcelle caracteristiqueParcelle) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueParcelleService.updateCaracteristiqueParcelle(id, caracteristiqueParcellePayloadWeb), "Caracteristique parcelle mise à jour avec succès."),
|
new ApiResponse<>(true, caracteristiqueParcelleService.updateCaracteristiqueParcelle(id, caracteristiqueParcelle), "Caracteristique parcelle mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -175,52 +174,4 @@ public class CaracteristiqueParcelleController {
|
|||||||
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-enquete-id/{enqueteId}")
|
|
||||||
public ResponseEntity<?> getAllCaracteristiqueParcelleList(@PathVariable Long enqueteId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, caracteristiqueParcelleService.getCaracteristiqueParcelleByEnqueteList(enqueteId), "Liste des Caracteristiques parcelles 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-enquete-id/{enqueteId}")
|
|
||||||
public ResponseEntity<?> getAllCaracteristiqueParcellePaged(@PathVariable Long enqueteId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, caracteristiqueParcelleService.getCaracteristiqueParcelleByEnqueteListPageable(enqueteId,pageable), "Liste des Caracteristiques parcelles 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
|||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueUniteLogementService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueUniteLogementService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueUniteLogementPayloadWeb;
|
|
||||||
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;
|
||||||
@@ -36,11 +35,11 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createCaracteristiqueUniteLogement(@RequestBody @Valid @Validated CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
|
public ResponseEntity<?> createCaracteristiqueUniteLogement(@RequestBody @Valid @Validated CaracteristiqueUniteLogement caracteristiqueUniteLogement) {
|
||||||
try {
|
try {
|
||||||
caracteristiqueUniteLogementPayloadWeb = caracteristiqueUniteLogementService.createCaracteristiqueUniteLogement(caracteristiqueUniteLogementPayloadWeb);
|
caracteristiqueUniteLogement = caracteristiqueUniteLogementService.createCaracteristiqueUniteLogement(caracteristiqueUniteLogement);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueUniteLogementPayloadWeb, "Caracteristique Unite Logement créé avec succès."),
|
new ApiResponse<>(true, caracteristiqueUniteLogement, "Caracteristique Unite Logement créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -60,10 +59,10 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateCaracteristiqueUniteLogement(@PathVariable Long id, @RequestBody CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) {
|
public ResponseEntity<?> updateCaracteristiqueUniteLogement(@PathVariable Long id, @RequestBody CaracteristiqueUniteLogement caracteristiqueUniteLogement) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, caracteristiqueUniteLogementService.updateCaracteristiqueUniteLogement(id, caracteristiqueUniteLogementPayloadWeb), "Caracteristique Unite Logement mise à jour avec succès."),
|
new ApiResponse<>(true, caracteristiqueUniteLogementService.updateCaracteristiqueUniteLogement(id, caracteristiqueUniteLogement), "Caracteristique Unite Logement mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -175,51 +174,4 @@ public class CaracteristiqueUniteLogementController {
|
|||||||
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-enquete-ulo-id/{enqueteUloId}")
|
|
||||||
public ResponseEntity<?> getAllCaracteristiqueUniteLogementListByEul(@PathVariable Long enqueteUloId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, caracteristiqueUniteLogementService.getCaracteristiqueUniteLogementListbyEul(enqueteUloId), "Liste des Caracteristiques Unite Logement 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-enquete-ulo-id/{enqueteUloId}")
|
|
||||||
public ResponseEntity<?> getAllCaracteristiqueUniteLogementByEulPaged(@PathVariable Long enqueteUloId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, caracteristiqueUniteLogementService.getCaracteristiqueUniteLogementListByEul(enqueteUloId,pageable), "Liste des Caracteristiques Unite Logement 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,226 +0,0 @@
|
|||||||
package io.gmss.fiscad.controllers.rfu.metier;
|
|
||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.exceptions.*;
|
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.DeclarationNcService;
|
|
||||||
import io.gmss.fiscad.interfaces.rfu.metier.EnqueteBatimentService;
|
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.DeclarationNcPayloadWeb;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.EnqueteBatimentPayloadWeb;
|
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.data.domain.PageRequest;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping(value = "api/declaration-nc", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
@SecurityRequirement(name = "bearer")
|
|
||||||
@Tag(name = "Déclaration NC")
|
|
||||||
@CrossOrigin(origins = "*")
|
|
||||||
public class DeclarationNcController {
|
|
||||||
|
|
||||||
private final DeclarationNcService declarationNcService;
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DeclarationNcController.class);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
public ResponseEntity<?> createDeclarationNc(@RequestBody @Valid @Validated DeclarationNcPayloadWeb declarationNcPayloadWeb) {
|
|
||||||
try {
|
|
||||||
declarationNcPayloadWeb = declarationNcService.createDeclarationNc(declarationNcPayloadWeb);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcPayloadWeb, "Déclaration NC créé 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
|
||||||
public ResponseEntity<?> updateEnqueteBatiment(@PathVariable Long id, @RequestBody DeclarationNcPayloadWeb declarationNcPayloadWeb) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcService.updateDeclarationNc(id, declarationNcPayloadWeb), "Enquete batiment mise à jour 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
|
||||||
public ResponseEntity<?> deleteEnqueteBatiment(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
declarationNcService.deleteDeclarationNc(id);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, "Déclaration Nc supprimé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("/all")
|
|
||||||
public ResponseEntity<?> getAllEnqueteBatimentList() {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcService.getDeclarationNcList(), "Liste des Enquetes 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("/all-paged")
|
|
||||||
public ResponseEntity<?> getAllEnqueteBatimentPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcService.getDeclarationNcList(pageable), "Liste des Enquetes 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("/id/{id}")
|
|
||||||
public ResponseEntity<?> getEnqueteBatimentById(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcService.getDeclarationNcById(id), "Enquete batiment 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/by-personne-id/{personneId}")
|
|
||||||
public ResponseEntity<?> getDeclarationNcByPersonne(@PathVariable Long personneId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcService.getDeclarationNcByPersonneList(personneId), "Déclarations NC 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page/by-personne-id/{personneId}")
|
|
||||||
public ResponseEntity<?> getDeclarationNcByPersonnePaged(@PathVariable Long personneId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, declarationNcService.getDeclarationNcByPersonneList(personneId,pageable), "Déclaration NC 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,10 +7,7 @@ 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.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
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.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;
|
||||||
@@ -163,104 +160,6 @@ public class DonneesImpositionTfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/all-page/by-imposition-id/{impositionId}")
|
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdPageable(impositionId, pageable), "Liste des caractéristiques 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("/all-page/by-imposition-id/non-batie/{impositionId}")
|
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdNonBatiePaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdNonBatiePageable(impositionId, pageable), "Liste des caractéristiques 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("/all-page/by-imposition-id/batie-batiment/{impositionId}")
|
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieBatimentPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(impositionId, pageable), "Liste des caractéristiques 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("/all-page/by-imposition-id/batie-unite-logement/{impositionId}")
|
|
||||||
public ResponseEntity<?> getAllDonneesImpositionTfuByImpositionIdBatieUniteLogPaged(@PathVariable Long impositionId, @RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, donneesImpositionTfuService.getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(impositionId, pageable), "Liste des caractéristiques 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("/id/{id}")
|
@GetMapping("/id/{id}")
|
||||||
public ResponseEntity<?> getDonneesImpositionTfuById(@PathVariable Long id) {
|
public ResponseEntity<?> getDonneesImpositionTfuById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
@@ -283,91 +182,31 @@ public class DonneesImpositionTfuController {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
|
@Operation(summary = "Générer les données fiscales TFU")
|
||||||
@PostMapping("/generer-batie")
|
@PostMapping("/generer")
|
||||||
public ResponseEntity<?> genererDonneesFiscaleBatie(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> genererDonneesFiscale(@RequestBody ImpositionsTfu impositionsTfu) {
|
||||||
try {
|
try {
|
||||||
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfu.getId());
|
||||||
|
|
||||||
if(optionalImpositionsTfu.isEmpty()){
|
if(optionalImpositionsTfu.isEmpty()){
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(false, null, "L'instance d'imposition n'est pas trouvée."),
|
new ApiResponse<>(false, null, "L'imposition tfu n'est pas trouvée."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.TFU_FNB_GENERE)){
|
if(!optionalImpositionsTfu.get().getStatusAvis().equals(StatusAvis.CREE)){
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(false, null, "l'état actuel : "+optionalImpositionsTfu.get().getStatusAvis()+" ne permet pas cette opération."),
|
new ApiResponse<>(false, null, "le statut actuel ne permet pas cette opération."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(userPrincipal==null){
|
optionalImpositionsTfu.get().setStatusAvis(StatusAvis.GENERE);
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleBatie(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId());
|
|
||||||
|
|
||||||
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, donneesImpositionTfuService.genererDonneesFiscales(optionalImpositionsTfu.get()), "DonneesImpositionTfu trouvée avec succès."),
|
||||||
HttpStatus.OK
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "Générer les données fiscales TFU des parcelle baties")
|
|
||||||
@PostMapping("/generer-non-batie")
|
|
||||||
public ResponseEntity<?> genererDonneesImpositionNonBaties(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
|
||||||
try {
|
|
||||||
Optional<ImpositionsTfu> optionalImpositionsTfu =impositionsTfuRepository.findById(impositionsTfuPaylaodWeb.getId());
|
|
||||||
|
|
||||||
if(optionalImpositionsTfu.isEmpty()){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, null, "L'instance d'imposition n'est pas trouvée."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
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){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, null, "Vous n'êtes pas autorisé à accéder à cette ressource"),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
impositionsTfuPaylaodWeb=donneesImpositionTfuService.genererDonneesFiscalesParcelleNonBatie(impositionsTfuPaylaodWeb,userPrincipal.getUser().getId());
|
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true,impositionsTfuPaylaodWeb, "Données d'imposition pour les fonciers non batis Générées avec succès."),
|
|
||||||
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);
|
||||||
|
|||||||
@@ -2,21 +2,12 @@ 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.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.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.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;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.ws.rs.NotAcceptableException;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
@@ -30,7 +21,6 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@AllArgsConstructor
|
|
||||||
@RequestMapping(value = "api/impositions-tfu", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/impositions-tfu", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Impositions TFU")
|
@Tag(name = "Impositions TFU")
|
||||||
@@ -38,32 +28,41 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
public class ImpositionsTfuController {
|
public class ImpositionsTfuController {
|
||||||
|
|
||||||
private final ImpositionsTfuService impositionsTfuService;
|
private final ImpositionsTfuService impositionsTfuService;
|
||||||
private final EnqueteService enqueteService;
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class);
|
private static final Logger logger = LoggerFactory.getLogger(ImpositionsTfuController.class);
|
||||||
|
|
||||||
|
public ImpositionsTfuController(ImpositionsTfuService impositionsTfuService) {
|
||||||
|
this.impositionsTfuService = impositionsTfuService;
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createImpositionsTfu(@CurrentUser UserPrincipal currentUser,@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> createImpositionsTfu(@RequestBody @Valid @Validated ImpositionsTfu impositionsTfu) {
|
||||||
try {
|
try {
|
||||||
if(currentUser==null){
|
impositionsTfu = impositionsTfuService.createImpositionsTfu(impositionsTfu);
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
User user=currentUser.getUser();
|
|
||||||
|
|
||||||
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(false, null, "Vous n'etes pas autorisé à accéder à cette ressource."),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
impositionsTfuPaylaodWeb = impositionsTfuService.createImpositionsTfu(impositionsTfuPaylaodWeb);
|
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuPaylaodWeb, "Unite de logement créé avec succès."),
|
new ApiResponse<>(true, impositionsTfu, "Unite de logement créé 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfu impositionsTfu) {
|
||||||
|
try {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, impositionsTfuService.updateImpositionsTfu(id, impositionsTfu), "Unite de logement mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -83,27 +82,11 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/cloturer-enquete")
|
@PutMapping("/valider/{id}")
|
||||||
public ResponseEntity<?> cloturer(@CurrentUser UserPrincipal userPrincipal, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb ) {
|
public ResponseEntity<?> validerImpositionsTfu(@RequestBody ImpositionsTfu impositionsTfu) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if(userPrincipal==null){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, null, "Accès non autorisé"),
|
|
||||||
HttpStatus.NOT_ACCEPTABLE
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
User user= userPrincipal.getUser();
|
|
||||||
if(user.getStructure().getId()!=impositionsTfuPaylaodWeb.getStructureId()){
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true,null, "Vous n'êtes pas autorisé à cloturer les enquetes du : "+user.getStructure().getNom()),
|
|
||||||
HttpStatus.OK
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuService.cloturerImpositionsTfu(impositionsTfuPaylaodWeb), "enquete cloturées avec succès."),
|
new ApiResponse<>(true, impositionsTfuService.validerImpositionsTfu(impositionsTfu), "Unite de logement mise à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -122,62 +105,11 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PutMapping("/update/{id}")
|
@PutMapping("/annuler/{id}")
|
||||||
// public ResponseEntity<?> updateImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
public ResponseEntity<?> annulerImpositionsTfu(@PathVariable Long id, @RequestBody ImpositionsTfu impositionsTfu) {
|
||||||
// try {
|
|
||||||
// return new ResponseEntity<>(
|
|
||||||
// new ApiResponse<>(true, impositionsTfuService.updateImpositionsTfu(id, impositionsTfuPaylaodWeb), "Unite de logement mise à jour 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);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "Autoriser la génération des avis d'un centre",
|
|
||||||
description = "Permet d'autoriser la génération des avis d'un centre pour un exervice données"
|
|
||||||
)
|
|
||||||
|
|
||||||
@PutMapping("/autoriser-generation-avis")
|
|
||||||
public ResponseEntity<?> autoriserImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, impositionsTfuService.autoriserGenerationImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
|
new ApiResponse<>(true, impositionsTfuService.annulerImpositionsTfu(impositionsTfu), "Unite de logement mise à jour 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/rejeter")
|
|
||||||
public ResponseEntity<?> annulerImpositionsTfu(@RequestBody ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, impositionsTfuService.rejeterImpositionsTfu(impositionsTfuPaylaodWeb), "Unite de logement mise à jour avec succès."),
|
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -220,19 +152,11 @@ public class ImpositionsTfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/all/by-user")
|
@GetMapping("/all")
|
||||||
public ResponseEntity<?> getAllImpositionsTfuList(@CurrentUser UserPrincipal userPrincipal) {
|
public ResponseEntity<?> getAllImpositionsTfuList() {
|
||||||
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.getImpositionsTfuByUserIdIds(user.getId()), "Liste des Enquetes des unites Logements chargée avec succès."),
|
new ApiResponse<>(true, impositionsTfuService.getImpositionsTfuList(), "Liste des Enquetes des unites Logements chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
|||||||
@@ -224,27 +224,4 @@ public class UniteLogementController {
|
|||||||
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-parcelle-id/{id}")
|
|
||||||
public ResponseEntity<?> getUniteLogementByParcelleId(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, enqueteUniteLogementService.getUniteLogementListByParcelle(id), "Unite de de logement 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,9 +2,8 @@ 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.BaremRfuBatiService;
|
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuService;
|
||||||
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;
|
||||||
@@ -25,20 +24,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 BaremRfuBatiService baremRfuBatiService;
|
private final BaremRfuService baremRfuService;
|
||||||
private static final Logger logger = LoggerFactory.getLogger(BaremRfuController.class);
|
private static final Logger logger = LoggerFactory.getLogger(BaremRfuController.class);
|
||||||
|
|
||||||
public BaremRfuController(BaremRfuBatiService baremRfuBatiService) {
|
public BaremRfuController(BaremRfuService baremRfuService) {
|
||||||
this.baremRfuBatiService = baremRfuBatiService;
|
this.baremRfuService = baremRfuService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
public ResponseEntity<?> createBaremRfu(@RequestBody @Valid @Validated BaremRfuBati baremRfuBati) {
|
||||||
try {
|
try {
|
||||||
baremRfuBatiPayloadWeb = baremRfuBatiService.createBaremRfu(baremRfuBatiPayloadWeb);
|
baremRfuBati = baremRfuService.createBaremRfu(baremRfuBati);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuBatiPayloadWeb, "BaremRfuBati créé avec succès."),
|
new ApiResponse<>(true, baremRfuBati, "BaremRfuBati créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -58,10 +57,10 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBatiPayloadWeb baremRfuBatiPayloadWeb) {
|
public ResponseEntity<?> updateBaremRfu(@PathVariable Long id, @RequestBody BaremRfuBati baremRfuBati) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuBatiService.updateBaremRfu(id, baremRfuBatiPayloadWeb), "BaremRfuBati mis à jour avec succès."),
|
new ApiResponse<>(true, baremRfuService.updateBaremRfu(id, baremRfuBati), "BaremRfuBati mis à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -83,7 +82,7 @@ public class BaremRfuController {
|
|||||||
@DeleteMapping("/delete/{id}")
|
@DeleteMapping("/delete/{id}")
|
||||||
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
|
public ResponseEntity<?> deleteBaremRfur(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
baremRfuBatiService.deleteBaremRfu(id);
|
baremRfuService.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
|
||||||
@@ -108,7 +107,7 @@ public class BaremRfuController {
|
|||||||
public ResponseEntity<?> getAllBaremRfuList() {
|
public ResponseEntity<?> getAllBaremRfuList() {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuBatiService.getBaremRfuList(), "Liste des baremRfus chargée avec succès."),
|
new ApiResponse<>(true, baremRfuService.getBaremRfuList(), "Liste des baremRfus chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -133,7 +132,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, baremRfuBatiService.getBaremRfuList(pageable), "Liste des baremRfus chargée avec succès."),
|
new ApiResponse<>(true, baremRfuService.getBaremRfuList(pageable), "Liste des baremRfus chargée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -156,7 +155,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, baremRfuBatiService.getBaremRfuById(id), "BaremRfuBati trouvée avec succès."),
|
new ApiResponse<>(true, baremRfuService.getBaremRfuById(id), "BaremRfuBati trouvée avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -175,68 +174,13 @@ public class BaremRfuController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/by-categorie-batiment-id/{idCategorieBatiment}")
|
@GetMapping("/categorie-batiment/{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, baremRfuBatiService.getBaremRfuByCategorieBatiment(idCategorieBatiment), "Liste des baremRfu par categorie de batiments chargée avec succès."),
|
new ApiResponse<>(true, baremRfuService.getBaremRfuByType(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) {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
|
|||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService;
|
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuNonBatiPayloadWeb;
|
|
||||||
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 +34,11 @@ public class BaremRfuNonBatiController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public ResponseEntity<?> createBaremRfuNonBati(@RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
|
public ResponseEntity<?> createBaremRfuNonBati(@RequestBody @Valid @Validated BaremRfuNonBati baremRfuNonBati) {
|
||||||
try {
|
try {
|
||||||
baremRfuNonBatiPayloadWeb = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBatiPayloadWeb);
|
baremRfuNonBati = baremRfuNonBatiService.createBaremRfuNonBati(baremRfuNonBati);
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuNonBatiPayloadWeb, "BaremRfuNonBati créé avec succès."),
|
new ApiResponse<>(true, baremRfuNonBati, "BaremRfuNonBati créé avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -59,10 +58,10 @@ public class BaremRfuNonBatiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) {
|
public ResponseEntity<?> updateBaremRfuNonBati(@PathVariable Long id, @RequestBody BaremRfuNonBati baremRfuNonBati) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuNonBatiService.updateBaremRfuNonBati(id, baremRfuNonBatiPayloadWeb), "BaremRfuNonBati mis à jour avec succès."),
|
new ApiResponse<>(true, baremRfuNonBatiService.updateBaremRfuNonBati(id, baremRfuNonBati), "BaremRfuNonBati mis à jour avec succès."),
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
@@ -157,31 +156,7 @@ public class BaremRfuNonBatiController {
|
|||||||
public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) {
|
public ResponseEntity<?> getBaremRfuNonBatiById(@PathVariable Long id) {
|
||||||
try {
|
try {
|
||||||
return new ResponseEntity<>(
|
return new ResponseEntity<>(
|
||||||
new ApiResponse<>(true, baremRfuNonBatiService.getBaremRfuNonBatiById(id).orElse(null), "BaremRfuNonBati trouvée avec succès."),
|
new ApiResponse<>(true, baremRfuNonBatiService.getBaremRfuNonBatiById(id), "BaremRfuNonBati 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-commune-id/by-zone-id/{communeId}/{zoneId}")
|
|
||||||
public ResponseEntity<?> getBaremRfuNonBatiByCommineAndZoneId(@PathVariable Long communeId, Long zoneId) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, baremRfuNonBatiService.getBaremRfuNonBatiByCommuneAndZoneId(communeId,zoneId).orElse(null), "BaremRfuNonBati trouvée avec succès."),
|
|
||||||
HttpStatus.OK
|
HttpStatus.OK
|
||||||
);
|
);
|
||||||
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
|||||||
@@ -1,180 +0,0 @@
|
|||||||
package io.gmss.fiscad.controllers.rfu.parametre;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import io.gmss.fiscad.exceptions.*;
|
|
||||||
import io.gmss.fiscad.interfaces.rfu.parametre.UsageService;
|
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.data.domain.PageRequest;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.client.HttpClientErrorException;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping(value = "api/usage", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
@SecurityRequirement(name = "bearer")
|
|
||||||
@Tag(name = "Usage")
|
|
||||||
public class UsageController {
|
|
||||||
|
|
||||||
private final UsageService usageService;
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(UsageController.class);
|
|
||||||
|
|
||||||
public UsageController(UsageService usageService) {
|
|
||||||
this.usageService = usageService;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
public ResponseEntity<?> createUsage(@RequestBody @Valid @Validated Usage usage) {
|
|
||||||
try {
|
|
||||||
usage = usageService.createUsage(usage);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, usage, "Usage créé 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
|
||||||
public ResponseEntity<?> updateUsage(@PathVariable Long id, @RequestBody Usage usage) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, usageService.updateUsage(id, usage), "Usage mis à jour 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete/{id}")
|
|
||||||
public ResponseEntity<?> deleteUsager(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
usageService.deleteUsage(id);
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, "Usage supprimé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("/all")
|
|
||||||
public ResponseEntity<?> getAllUsageList() {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, usageService.getUsageList(), "Liste des usages 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("/all-paged")
|
|
||||||
public ResponseEntity<?> getAllUsagePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
|
||||||
try {
|
|
||||||
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
|
||||||
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, usageService.getUsageList(pageable), "Liste des usages 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("/id/{id}")
|
|
||||||
public ResponseEntity<?> getUsageById(@PathVariable Long id) {
|
|
||||||
try {
|
|
||||||
return new ResponseEntity<>(
|
|
||||||
new ApiResponse<>(true, usageService.getUsageById(id), "Usage 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
|||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "api/profil", produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "api/profile", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@SecurityRequirement(name = "bearer")
|
@SecurityRequirement(name = "bearer")
|
||||||
@Tag(name = "Profile")
|
@Tag(name = "Profile")
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ public class Quartier extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Arrondissement arrondissement;
|
private Arrondissement arrondissement;
|
||||||
|
|
||||||
private String longitude;
|
|
||||||
private String latitude;
|
|
||||||
// @JsonIgnore
|
// @JsonIgnore
|
||||||
// @OneToOne(mappedBy = "quartier")
|
// @OneToOne(mappedBy = "quartier")
|
||||||
// private Bloc bloc;
|
// private Bloc bloc;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
|||||||
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.infocad.parametre.Bloc;
|
import io.gmss.fiscad.entities.infocad.parametre.Bloc;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.ModeAcquisition;
|
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
|
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
||||||
@@ -75,10 +74,6 @@ public class Enquete extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Exercice exercice;
|
private Exercice exercice;
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@ManyToOne
|
|
||||||
private ModeAcquisition modeAcquisition;
|
|
||||||
|
|
||||||
private Long mobileDataId;
|
private Long mobileDataId;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@@ -188,8 +183,6 @@ public class Enquete extends BaseEntity implements Serializable {
|
|||||||
private Long montantAnnuelleLocation;
|
private Long montantAnnuelleLocation;
|
||||||
private Long valeurParcelleEstime;
|
private Long valeurParcelleEstime;
|
||||||
private Long valeurParcelleReel;
|
private Long valeurParcelleReel;
|
||||||
private Long valeurParcelleCalcule;
|
|
||||||
private String ncProprietaire;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
@@ -198,11 +191,6 @@ public class Enquete extends BaseEntity implements Serializable {
|
|||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateFinExcemption;
|
private LocalDate dateFinExcemption;
|
||||||
|
|
||||||
private String representantNom;
|
|
||||||
private String representantPrenom;
|
|
||||||
private String representantTel;
|
|
||||||
private String representantNpi;
|
|
||||||
//
|
//
|
||||||
// @JsonIgnore
|
// @JsonIgnore
|
||||||
// @OneToMany(mappedBy = "enquete")
|
// @OneToMany(mappedBy = "enquete")
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
package io.gmss.fiscad.entities.infocad.metier;
|
package io.gmss.fiscad.entities.infocad.metier;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
||||||
import io.gmss.fiscad.deserializer.LocalDateDeserializer;
|
|
||||||
import io.gmss.fiscad.entities.BaseEntity;
|
import io.gmss.fiscad.entities.BaseEntity;
|
||||||
import io.gmss.fiscad.entities.decoupage.Quartier;
|
import io.gmss.fiscad.entities.decoupage.Quartier;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
|
import io.gmss.fiscad.entities.infocad.parametre.NatureDomaine;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.TypeDomaine;
|
import io.gmss.fiscad.entities.infocad.parametre.TypeDomaine;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.Batiment;
|
import io.gmss.fiscad.entities.rfu.metier.Batiment;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
@@ -72,17 +68,6 @@ public class Parcelle extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Rue rue ;
|
private Rue rue ;
|
||||||
private String numeroRue ;
|
private String numeroRue ;
|
||||||
private Boolean batie;
|
|
||||||
private Integer nombrePiscine;
|
|
||||||
@ManyToOne
|
|
||||||
private Usage usage;
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateDebutExemption;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateFinExemption;
|
|
||||||
// private String ncProprietaire ;
|
// private String ncProprietaire ;
|
||||||
// @JsonIgnore
|
// @JsonIgnore
|
||||||
// @OneToMany(mappedBy = "parcelle")
|
// @OneToMany(mappedBy = "parcelle")
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
|||||||
import io.gmss.fiscad.entities.decoupage.Commune;
|
import io.gmss.fiscad.entities.decoupage.Commune;
|
||||||
import io.gmss.fiscad.entities.decoupage.Departement;
|
import io.gmss.fiscad.entities.decoupage.Departement;
|
||||||
import io.gmss.fiscad.entities.decoupage.Quartier;
|
import io.gmss.fiscad.entities.decoupage.Quartier;
|
||||||
import io.gmss.fiscad.enums.SourceDonnee;
|
|
||||||
import io.gmss.fiscad.enums.StatutParcelle;
|
import io.gmss.fiscad.enums.StatutParcelle;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -25,7 +24,6 @@ import org.n52.jackson.datatype.jts.GeometryDeserializer;
|
|||||||
import org.n52.jackson.datatype.jts.GeometrySerializer;
|
import org.n52.jackson.datatype.jts.GeometrySerializer;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Entity
|
@Entity
|
||||||
@@ -41,63 +39,27 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private String NomDepartement;
|
||||||
|
private String NomCommune;
|
||||||
|
private String NomArrondissement;
|
||||||
|
private String NomVillageQuartier;
|
||||||
|
private String codeBloc;
|
||||||
|
private String q;
|
||||||
|
private String ilot;
|
||||||
|
private String zone;
|
||||||
|
private String p;
|
||||||
@Column(unique = true,nullable = true)
|
@Column(unique = true,nullable = true)
|
||||||
private String nup;
|
private String nup;
|
||||||
@Column(unique = true,nullable = true)
|
@Column(unique = true,nullable = true)
|
||||||
private String nupProvisoire;
|
private String nupProvisoire;
|
||||||
private String longitude;
|
private String longitude;
|
||||||
private String latitude;
|
private String latitude;
|
||||||
private String codeDepartement;
|
|
||||||
private String nomDepartement;
|
|
||||||
private String codeCommune;
|
|
||||||
private String nomCommune;
|
|
||||||
private String codeArrondissement;
|
|
||||||
private String nomArrondissement;
|
|
||||||
private String codeQuartierVillage;
|
|
||||||
private String nomVillageQuartier;
|
|
||||||
private String codeBloc;
|
|
||||||
private String numeroRue;
|
|
||||||
private String numeroEntreePorte;
|
|
||||||
|
|
||||||
private String codeInstad;
|
|
||||||
private String numeroEtatLieux;
|
|
||||||
private String numeroTitreFoncier;
|
|
||||||
private LocalDate dateTitreFoncier;
|
|
||||||
private Boolean batie ;
|
|
||||||
|
|
||||||
private String npi;
|
|
||||||
private String ifu;
|
|
||||||
private String nom;
|
|
||||||
private String prenom;
|
|
||||||
private String raisonSociale;
|
|
||||||
private String nomEtPrenoms;
|
|
||||||
private String telephone;
|
|
||||||
private String adresse;
|
|
||||||
|
|
||||||
private String nomRepresentant;
|
|
||||||
private String prenomRepresentant;
|
|
||||||
private String raisonSocialeRepresentant;
|
|
||||||
private String nomEtPrenomsRepresentant;
|
|
||||||
private String telephoneRepresentant;
|
|
||||||
private String adresseRepresentant;
|
|
||||||
|
|
||||||
private String q;
|
|
||||||
private String zone;
|
|
||||||
private String ilot;
|
|
||||||
private String p;
|
|
||||||
|
|
||||||
private String qLotissement;
|
|
||||||
private String ilotLotissement;
|
|
||||||
private String pLotissement;
|
|
||||||
|
|
||||||
private String pointsPolygone;
|
private String pointsPolygone;
|
||||||
private Integer superficie;
|
private Integer superficie;
|
||||||
|
private String nomEtPrenoms;
|
||||||
private String dateCollecte;
|
private String dateCollecte;
|
||||||
@Enumerated(EnumType.STRING)
|
private String sourceDonnees;
|
||||||
private SourceDonnee sourceDonnees;
|
|
||||||
private String observations;
|
private String observations;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private StatutParcelle statutParcelle;
|
private StatutParcelle statutParcelle;
|
||||||
private Long uploadId;
|
private Long uploadId;
|
||||||
@@ -115,22 +77,35 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
|
|||||||
private Arrondissement arrondissement;
|
private Arrondissement arrondissement;
|
||||||
|
|
||||||
@ManyToOne //(fetch = FetchType.LAZY)
|
@ManyToOne //(fetch = FetchType.LAZY)
|
||||||
@JsonBackReference
|
//@JsonBackReference
|
||||||
private Quartier quartier ;
|
private Quartier quartier ;
|
||||||
|
|
||||||
@ColumnDefault("0")
|
@ColumnDefault("0")
|
||||||
private Integer geomSrid;
|
private int geomSrid;
|
||||||
@JsonSerialize(using = GeometrySerializer.class)
|
@JsonSerialize(using = GeometrySerializer.class)
|
||||||
@JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
@JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||||
@Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)")
|
@Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)")
|
||||||
private Polygon geometry;
|
private Polygon geometry;
|
||||||
@Column(columnDefinition = "TEXT")
|
@Column(columnDefinition = "TEXT")
|
||||||
private String geometryString;
|
private String geometryString;
|
||||||
|
private String codeInsae;
|
||||||
|
private String numeroEtatLieux;
|
||||||
|
private String numeroTitreFoncier;
|
||||||
|
private String telephone;
|
||||||
|
//private String codeParcelle;
|
||||||
|
//private String codeEquipe;
|
||||||
|
|
||||||
@JsonIgnore
|
//private String elLot;
|
||||||
@ManyToOne
|
//private String elLettreParcelle;
|
||||||
@JsonBackReference
|
//private String rfuQuartierOuZone;
|
||||||
private Parcelle parcelle;
|
//private String rfuIlot;
|
||||||
|
//private String rfuLettreParcelle;
|
||||||
|
|
||||||
|
//private String nomLotissement;
|
||||||
|
////////////
|
||||||
|
// @JsonIgnore
|
||||||
|
// @OneToOne
|
||||||
|
// private Parcelle parcelle;
|
||||||
// @JsonSerialize(using = GeometrySerializer.class)
|
// @JsonSerialize(using = GeometrySerializer.class)
|
||||||
// @JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
// @JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||||
// @Column(name = "geom",columnDefinition = "geometry(Polygon,4326)")
|
// @Column(name = "geom",columnDefinition = "geometry(Polygon,4326)")
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
|||||||
import io.gmss.fiscad.entities.infocad.parametre.SourceDroit;
|
import io.gmss.fiscad.entities.infocad.parametre.SourceDroit;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.TypePiece;
|
import io.gmss.fiscad.entities.infocad.parametre.TypePiece;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteBatiment;
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.EnqueteUniteLogement;
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -73,16 +71,6 @@ public class Piece extends BaseEntity implements Serializable {
|
|||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
private Enquete enquete ;
|
private Enquete enquete ;
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@JsonBackReference
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
private EnqueteBatiment enqueteBatiment ;
|
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
@JsonBackReference
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
private EnqueteUniteLogement enqueteUniteLogement ;
|
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private ModeAcquisition modeAcquisition;
|
private ModeAcquisition modeAcquisition;
|
||||||
|
|
||||||
|
|||||||
@@ -97,17 +97,17 @@ public class Upload extends BaseEntity implements Serializable {
|
|||||||
System.out.println("url = " + url);
|
System.out.println("url = " + url);
|
||||||
// return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null;
|
// return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null;
|
||||||
return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null;
|
return url != null ? url.toLowerCase().startsWith("https") ? url : url.toLowerCase().replaceFirst("http", "https") : null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String serverContext() {
|
private String serverContext() {
|
||||||
String url= ServletUriComponentsBuilder.fromCurrentContextPath()
|
String url= ServletUriComponentsBuilder.fromCurrentContextPath()
|
||||||
.path("/api/upload/downloadFile/")
|
.path("/api/upload/downloadFile/")
|
||||||
.toUriString();
|
.toUriString();
|
||||||
//System.out.println(url);
|
if(!url.contains("8282/api")){
|
||||||
// if(!url.contains("8282/api")){
|
url.replace("/api",":8282/api");
|
||||||
// url.replace("/api",":8282/api");
|
}
|
||||||
// }
|
|
||||||
//System.out.println(url);
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
|||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||||
import io.gmss.fiscad.entities.metadata.MobileDataPersonne;
|
import io.gmss.fiscad.entities.metadata.MobileDataPersonne;
|
||||||
import io.gmss.fiscad.enums.Categorie;
|
import io.gmss.fiscad.enums.Categorie;
|
||||||
import io.gmss.fiscad.enums.EtatIdentificationPersonne;
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -80,12 +79,7 @@ public class Personne extends BaseEntity implements Serializable {
|
|||||||
private int mustHaveRepresentant;
|
private int mustHaveRepresentant;
|
||||||
private String filePath;
|
private String filePath;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private EtatIdentificationPersonne etatIdentificationPersonne;
|
|
||||||
private String observation;
|
private String observation;
|
||||||
private String numeroRccm ;
|
|
||||||
private LocalDate dateRccm ;
|
|
||||||
private String email ;
|
|
||||||
@ColumnDefault("false")
|
@ColumnDefault("false")
|
||||||
private boolean synchronise;
|
private boolean synchronise;
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,11 @@ 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.Parcelle;
|
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.hibernate.Internal;
|
|
||||||
import org.hibernate.annotations.Where;
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -39,40 +36,15 @@ public class Batiment extends BaseEntity implements Serializable {
|
|||||||
private Long idDerniereEnquete;
|
private Long idDerniereEnquete;
|
||||||
private Float superficieLouee;
|
private Float superficieLouee;
|
||||||
private Float superficieAuSol;
|
private Float superficieAuSol;
|
||||||
private Integer nombreEtage;
|
|
||||||
private Integer nombrePiscine;
|
|
||||||
private Long montantLocatifAnnuelDeclare;
|
|
||||||
private Long montantLocatifAnnuelCalcule;
|
|
||||||
private Long montantLocatifAnnuelEstime;
|
|
||||||
private Long valeurBatimentEstime;
|
|
||||||
private Long valeurBatimentReel;
|
|
||||||
private Long valeurBatimentCalcule;
|
|
||||||
private Long montantMensuelLocation;
|
|
||||||
private Integer nbreUniteLogement;
|
|
||||||
private Integer idToitRfu;
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Parcelle parcelle;
|
private Parcelle parcelle;
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
private Usage usage;
|
|
||||||
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
private CategorieBatiment categorieBatiment ;
|
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Tpe terminal;
|
private Tpe terminal;
|
||||||
// private Long enqueteId;
|
// private Long enqueteId;
|
||||||
private Long mobileDataId;
|
private Long mobileDataId;
|
||||||
private Long parcelleExternalKey;
|
private Long parcelleExternalKey;
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateDebutExemption;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateFinExemption;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ public class CaracteristiqueParcelle extends BaseEntity implements Serializable
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Caracteristique caracteristique;
|
private Caracteristique caracteristique;
|
||||||
private String valeur;
|
private String valeur;
|
||||||
private String observation;
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Tpe terminal;
|
private Tpe terminal;
|
||||||
|
|||||||
@@ -47,5 +47,3 @@ public class CaracteristiqueUniteLogement extends BaseEntity implements Serializ
|
|||||||
private Long enqueteId;
|
private Long enqueteId;
|
||||||
private Long mobileDataId;
|
private Long mobileDataId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,22 +32,18 @@ public class DeclarationNc extends BaseEntity implements Serializable {
|
|||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateDerniereDeclaration;
|
private LocalDate dateDerniereDeclaration;
|
||||||
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateDeclarationNc;
|
|
||||||
|
|
||||||
private String nc;
|
private String nc;
|
||||||
private String observation;
|
|
||||||
|
|
||||||
@JsonIgnore
|
@OneToOne
|
||||||
@ManyToOne
|
|
||||||
private Structure structure;
|
private Structure structure;
|
||||||
|
|
||||||
|
// @JsonIgnore
|
||||||
|
// @ManyToOne
|
||||||
|
// private Enquete enquete;
|
||||||
|
|
||||||
private Long enqueteExternalKey;
|
private Long enqueteExternalKey;
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ 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.metier.Parcelle;
|
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Structure;
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.ZoneRfu;
|
|
||||||
import io.gmss.fiscad.enums.NatureImpot;
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -74,17 +71,11 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
|
|||||||
private int superficieParc;
|
private int superficieParc;
|
||||||
private Long superficieAuSolBat;
|
private Long superficieAuSolBat;
|
||||||
private Long superficieAuSolUlog;
|
private Long superficieAuSolUlog;
|
||||||
//private String batieOuiNon;
|
private String batieOuiNon;
|
||||||
//private String exhonereOuiNon;
|
private String exhonereOuiNon;
|
||||||
//private String batimentExhonereOuiNon;
|
private String batimentExhonereOuiNon;
|
||||||
//private String uniteLogementExhonereOuiNon;
|
private String uniteLogementExhonereOuiNon;
|
||||||
private Boolean batie;
|
|
||||||
private Boolean exonere;
|
|
||||||
private Boolean batimentExonere;
|
|
||||||
private Boolean uniteLogementExonere;
|
|
||||||
private Long valeurLocativeAdm;
|
private Long valeurLocativeAdm;
|
||||||
private Long valeurLocativeAdm70Pour100;
|
|
||||||
private Long valeurLocativeAdmMetreCarre;
|
|
||||||
private Long montantLoyerAnnuel;
|
private Long montantLoyerAnnuel;
|
||||||
private Long tfuMetreCarre;
|
private Long tfuMetreCarre;
|
||||||
private Long tfuMinimum;
|
private Long tfuMinimum;
|
||||||
@@ -97,30 +88,14 @@ public class DonneesImpositionTfu extends BaseEntity implements Serializable {
|
|||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateEnquete;
|
private LocalDate dateEnquete;
|
||||||
private Long enqueteId;
|
private Long enqueteId;
|
||||||
//private Long structureId;
|
private Long structureId;
|
||||||
@JsonIgnore
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumn(name = "structure_id")
|
|
||||||
private Structure structure ;
|
|
||||||
|
|
||||||
private Long secteurId;
|
private Long secteurId;
|
||||||
|
private Long zoneRfuId;
|
||||||
//private Long zoneRfuId;
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumn(name = "zone_rfu_id")
|
|
||||||
private ZoneRfu zoneRfu ;
|
|
||||||
|
|
||||||
@ColumnDefault("0")
|
@ColumnDefault("0")
|
||||||
private Long valeurAdminParcelleNb;
|
private float tauxParcelleNonBati;
|
||||||
private Float tauxTfu;
|
private Long valeurAdministrativeParcelleNonBati;
|
||||||
private Float montantTaxe;
|
|
||||||
private Long valeurAdminParcelleNbMetreCarre;
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "impositions_tfu_id", nullable = false)
|
@JoinColumn(name = "impositions_tfu_id", nullable = false)
|
||||||
private ImpositionsTfu impositionsTfu ;
|
private ImpositionsTfu impositionsTfu;
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private NatureImpot natureImpot;
|
|
||||||
private Long valeurBatiment;
|
|
||||||
private Long valeurParcelle;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,8 @@ import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
|||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
|
import io.gmss.fiscad.entities.rfu.parametre.Caracteristique;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import io.gmss.fiscad.entities.user.User;
|
import io.gmss.fiscad.entities.user.User;
|
||||||
import io.gmss.fiscad.enums.StatutEnquete;
|
|
||||||
import io.gmss.fiscad.enums.StatutEnregistrement;
|
import io.gmss.fiscad.enums.StatutEnregistrement;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -54,8 +51,6 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
|||||||
private Boolean soneb;
|
private Boolean soneb;
|
||||||
private String numCompteurSoneb;
|
private String numCompteurSoneb;
|
||||||
private Integer nbreLotUnite;
|
private Integer nbreLotUnite;
|
||||||
private Integer nbreUniteLogement;
|
|
||||||
private Integer nbrePiece;
|
|
||||||
private Integer nbreUniteLocation;
|
private Integer nbreUniteLocation;
|
||||||
private Float superficieLouee;
|
private Float superficieLouee;
|
||||||
private Float superficieAuSol;
|
private Float superficieAuSol;
|
||||||
@@ -63,12 +58,8 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
|||||||
private Integer nbreHabitant;
|
private Integer nbreHabitant;
|
||||||
private Long montantMensuelLocation;
|
private Long montantMensuelLocation;
|
||||||
private Long montantLocatifAnnuelDeclare;
|
private Long montantLocatifAnnuelDeclare;
|
||||||
private Long montantLocatifAnnuelEstime;
|
|
||||||
private Long montantLocatifAnnuelCalcule;
|
|
||||||
private Long valeurBatimentEstime;
|
private Long valeurBatimentEstime;
|
||||||
private Long valeurBatimentReel;
|
private Long valeurBatimentReel;
|
||||||
private Long valeurBatimentCalcule;
|
|
||||||
private Integer nombrePiscine;
|
|
||||||
private Integer nbreMoisLocation;
|
private Integer nbreMoisLocation;
|
||||||
private String autreCaracteristiquePhysique;
|
private String autreCaracteristiquePhysique;
|
||||||
private String observation;
|
private String observation;
|
||||||
@@ -104,11 +95,6 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
|||||||
private Long batimentExternalKey;
|
private Long batimentExternalKey;
|
||||||
private Long nbreEtage;
|
private Long nbreEtage;
|
||||||
|
|
||||||
private String representantNom;
|
|
||||||
private String representantPrenom;
|
|
||||||
private String representantTel;
|
|
||||||
private String representantNpi;
|
|
||||||
|
|
||||||
// @JsonIgnore
|
// @JsonIgnore
|
||||||
// @ManyToOne(fetch = FetchType.LAZY)
|
// @ManyToOne(fetch = FetchType.LAZY)
|
||||||
// @JsonBackReference
|
// @JsonBackReference
|
||||||
@@ -131,12 +117,7 @@ public class EnqueteBatiment extends BaseEntity implements Serializable {
|
|||||||
@OneToMany(mappedBy = "enqueteBatiment")
|
@OneToMany(mappedBy = "enqueteBatiment")
|
||||||
private List<Upload> uploads;
|
private List<Upload> uploads;
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
//@Enumerated(EnumType.STRING)
|
||||||
@JsonIgnore
|
//@JsonIgnore
|
||||||
private StatutEnquete statutEnquete;
|
//private StatutEnregistrement statutEnregistrement;
|
||||||
@ManyToOne
|
|
||||||
private CategorieBatiment categorieBatiment ;
|
|
||||||
@ManyToOne
|
|
||||||
private Usage usage ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,8 @@ import io.gmss.fiscad.entities.infocad.metier.Enquete;
|
|||||||
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
import io.gmss.fiscad.entities.rfu.parametre.Exercice;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import io.gmss.fiscad.entities.user.User;
|
import io.gmss.fiscad.entities.user.User;
|
||||||
import io.gmss.fiscad.enums.StatutEnquete;
|
|
||||||
import io.gmss.fiscad.enums.StatutEnregistrement;
|
import io.gmss.fiscad.enums.StatutEnregistrement;
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -49,15 +46,11 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
|||||||
private Integer nbreHabitant;
|
private Integer nbreHabitant;
|
||||||
private Integer nbreMenage;
|
private Integer nbreMenage;
|
||||||
private Boolean enLocation;
|
private Boolean enLocation;
|
||||||
private Long montantMensuelLocation;
|
private Float montantMensuelLoyer;
|
||||||
private Integer nbreMoisLocation;
|
private Integer nbreMoisLocation;
|
||||||
private Long montantLocatifAnnuelDeclare;
|
private Float montantLocatifAnnuelDeclare;
|
||||||
private Long montantLocatifAnnuelCalcule;
|
|
||||||
private Long montantLocatifAnnuelEstime;
|
|
||||||
private Long valeurUniteLogementEstime;
|
private Long valeurUniteLogementEstime;
|
||||||
private Long valeurUniteLogementReel;
|
private Long valeurUniteLogementReel;
|
||||||
private Long valeurUniteLogementCalcule;
|
|
||||||
private Integer nombrePiscine;
|
|
||||||
private Float superficieLouee;
|
private Float superficieLouee;
|
||||||
private Float superficieAuSol;
|
private Float superficieAuSol;
|
||||||
private Boolean sbee;
|
private Boolean sbee;
|
||||||
@@ -70,22 +63,16 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
|||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateFinExemption;
|
private LocalDate dateFinExemption;
|
||||||
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
private LocalDate dateEnquete;
|
private LocalDate dateEnquete;
|
||||||
private String observation;
|
private String observation;
|
||||||
private Long uniteLogementExternalKey;
|
private Long uniteLogementExternalKey;
|
||||||
|
|
||||||
private String representantNom;
|
|
||||||
private String representantPrenom;
|
|
||||||
private String representantTel;
|
|
||||||
private String representantNpi;
|
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Exercice exercice;
|
private Exercice exercice;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @JsonIgnore
|
// @JsonIgnore
|
||||||
// @ManyToOne(fetch = FetchType.LAZY)
|
// @ManyToOne(fetch = FetchType.LAZY)
|
||||||
// @JsonBackReference
|
// @JsonBackReference
|
||||||
@@ -119,9 +106,6 @@ public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
|||||||
private List<Upload> uploads;
|
private List<Upload> uploads;
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private StatutEnquete statutEnquete;
|
private StatutEnregistrement statutEnregistrement;
|
||||||
@ManyToOne
|
|
||||||
private CategorieBatiment categorieBatiment ;
|
|
||||||
@ManyToOne
|
|
||||||
private Usage usage ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.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;
|
||||||
@@ -34,39 +33,24 @@ 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 Integer nombreAvis;
|
|
||||||
private Integer nombreAvisFnb;
|
|
||||||
private Integer nombreAvisBatiment;
|
|
||||||
private Integer nombreAvisUniteLog;
|
|
||||||
|
|
||||||
@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;
|
||||||
|
|
||||||
|
public Long getNombreAvis(){
|
||||||
|
return donneesImpositionTfus==null?0l:donneesImpositionTfus.size();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ 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;
|
||||||
|
|||||||
@@ -6,8 +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.Tpe;
|
import io.gmss.fiscad.entities.infocad.metier.Tpe;
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.CategorieBatiment;
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -41,33 +39,13 @@ public class UniteLogement extends BaseEntity implements Serializable {
|
|||||||
private List<EnqueteUniteLogement> enqueteUniteLogements;
|
private List<EnqueteUniteLogement> enqueteUniteLogements;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Batiment batiment;
|
private Batiment batiment;
|
||||||
@ManyToOne
|
|
||||||
private Usage usage;
|
|
||||||
private Long batimentExternalKey;
|
private Long batimentExternalKey;
|
||||||
private Long idDerniereEnquete;
|
private Long idDerniereEnquete;
|
||||||
private Float SuperficieLouee;
|
private Float SuperficieLouee;
|
||||||
private Float SuperficieAuSol;
|
private Float SuperficieAuSol;
|
||||||
private Long montantMensuelLocation;
|
|
||||||
private Long montantLocatifAnnuelDeclare;
|
|
||||||
private Long montantLocatifAnnuelCalcule;
|
|
||||||
private Long valeurUniteLogementEstime;
|
|
||||||
private Long valeurUniteLogementReel;
|
|
||||||
private Long valeurUniteLogementCalcule;
|
|
||||||
private Integer nombrePiscine;
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Tpe terminal;
|
private Tpe terminal;
|
||||||
private Long enqueteId;
|
private Long enqueteId;
|
||||||
private Long mobileDataId;
|
private Long mobileDataId;
|
||||||
@ManyToOne
|
|
||||||
private CategorieBatiment categorieBatiment ;
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateDebutExemption;
|
|
||||||
|
|
||||||
@JsonFormat(pattern = "dd-MM-yyyy")
|
|
||||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
|
||||||
private LocalDate dateFinExemption;
|
|
||||||
private Integer idToitRfu;
|
|
||||||
private Integer nombreEtage;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ 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;
|
||||||
@@ -29,6 +28,4 @@ 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 ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ public class BaremRfuNonBati extends BaseEntity implements Serializable {
|
|||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long valeurAdministrative;
|
private Long valeurAdministrative;
|
||||||
private Long valeurAdministrativeMetreCarre;
|
private float taux;
|
||||||
private Boolean auMetreCarre;
|
|
||||||
private Float taux;
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Commune commune;
|
private Commune commune;
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|||||||
@@ -23,5 +23,4 @@ public class CategorieBatiment extends BaseEntity implements Serializable {
|
|||||||
@Column(unique = true)
|
@Column(unique = true)
|
||||||
private String code;
|
private String code;
|
||||||
private String nom;
|
private String nom;
|
||||||
private String standing;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
package io.gmss.fiscad.entities.rfu.parametre;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.BaseEntity;
|
|
||||||
import io.gmss.fiscad.enums.CategorieUsage;
|
|
||||||
import jakarta.persistence.*;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.hibernate.annotations.Where;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Entity
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Where(clause = " deleted = false")
|
|
||||||
public class Usage extends BaseEntity implements Serializable {
|
|
||||||
@Id
|
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
private Long id;
|
|
||||||
private String code;
|
|
||||||
private String nom;
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private CategorieUsage categorieUsage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
package io.gmss.fiscad.enums;
|
|
||||||
|
|
||||||
public enum CategorieUsage {
|
|
||||||
|
|
||||||
HABITATION,
|
|
||||||
PROFESSIONNELLE,
|
|
||||||
MIXTE
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
package io.gmss.fiscad.enums;
|
|
||||||
|
|
||||||
public enum EtatIdentificationPersonne {
|
|
||||||
IFU,
|
|
||||||
NPI,
|
|
||||||
IFU_NPI,
|
|
||||||
NEANT,
|
|
||||||
RFU;
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
package io.gmss.fiscad.enums;
|
|
||||||
|
|
||||||
public enum NatureImpot {
|
|
||||||
TFU,
|
|
||||||
IRF
|
|
||||||
}
|
|
||||||
@@ -11,9 +11,5 @@ public enum ParametersType {
|
|||||||
OBJET_RESET_PASSWORD,
|
OBJET_RESET_PASSWORD,
|
||||||
CORPS_RESET_PASSWORD,
|
CORPS_RESET_PASSWORD,
|
||||||
OBJET_CREATE_ACCOUNT,
|
OBJET_CREATE_ACCOUNT,
|
||||||
CORPS_CREATE_ACCOUNT,
|
CORPS_CREATE_ACCOUNT;
|
||||||
TOKEN_IFU_EN_LIGNE,
|
|
||||||
TAUX_TFU_HABITATION,
|
|
||||||
TAUX_TFU_PROFESSIONNELLE,
|
|
||||||
TAUX_DEFAUT_SUPERFICIE_AU_SOL;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
package io.gmss.fiscad.enums;
|
|
||||||
|
|
||||||
public enum SourceDonnee {
|
|
||||||
RFU,
|
|
||||||
ANDF,
|
|
||||||
SIGIBE
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
package io.gmss.fiscad.enums;
|
package io.gmss.fiscad.enums;
|
||||||
|
|
||||||
public enum StatusAvis {
|
public enum StatusAvis {
|
||||||
EN_COURS,
|
CREE,
|
||||||
CLOTURE,
|
GENERE,
|
||||||
GENERATION_AUTORISE,
|
ANNULE,
|
||||||
REJETE,
|
VALIDE,
|
||||||
TFU_FNB_GENERE,
|
|
||||||
GENERE
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,8 @@ package io.gmss.fiscad.enums;
|
|||||||
|
|
||||||
public enum StatutEnquete {
|
public enum StatutEnquete {
|
||||||
EN_COURS,
|
EN_COURS,
|
||||||
// DECLARATION,
|
|
||||||
FINALISE,
|
FINALISE,
|
||||||
REJETE,
|
REJETE,
|
||||||
VALIDE,
|
VALIDE,
|
||||||
ECHEC,
|
ECHEC
|
||||||
CLOTURE
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package io.gmss.fiscad.enums;
|
|||||||
|
|
||||||
public enum StatutParcelle {
|
public enum StatutParcelle {
|
||||||
NON_ENQUETER,
|
NON_ENQUETER,
|
||||||
AJOUR,
|
ENQUETER_NON_BATIE_AJOUR,
|
||||||
NON_AJOUR;
|
ENQUETER_BATIE_AJOUR,
|
||||||
|
ENQUETER_NON_BATIE_NON_AJOUR,
|
||||||
|
ENQUETER_BATIE_NON_AJOUR
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,15 +163,8 @@ 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,7 +43,6 @@ 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;
|
||||||
@@ -92,7 +91,9 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnquetePayLoadWeb createEnquete(EnquetePayLoadWeb enquetePayLoadWeb) throws BadRequestException {
|
public Enquete createEnquete(EnquetePayLoadWeb enquetePayLoadWeb) throws BadRequestException {
|
||||||
|
Optional<Parcelle> optionalParcelle=Optional.empty();
|
||||||
|
Long rueId;
|
||||||
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
|
Optional<User> optionalUser = userRepository.findById(enquetePayLoadWeb.getEnqueteurId());
|
||||||
if (!optionalUser.isPresent()) {
|
if (!optionalUser.isPresent()) {
|
||||||
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
|
throw new BadRequestException("Echec de l'enregistrement : Enquêteur inexistant");
|
||||||
@@ -102,11 +103,6 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant");
|
throw new BadRequestException("Echec de l'enregistrement : Propriétaire inexistant");
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(enquetePayLoadWeb.getParcelleId());
|
|
||||||
if (!optionalParcelle.isPresent()) {
|
|
||||||
throw new BadRequestException("Echec de l'enregistrement : Parcelle inexistante");
|
|
||||||
}
|
|
||||||
|
|
||||||
Optional<ZoneRfu> optionalZoneRfu = zoneRfuRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
Optional<ZoneRfu> optionalZoneRfu = zoneRfuRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
||||||
if (!optionalZoneRfu.isPresent()) {
|
if (!optionalZoneRfu.isPresent()) {
|
||||||
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
||||||
@@ -114,10 +110,37 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
|
|
||||||
if (enquetePayLoadWeb.getParcelleId() == null) {
|
if (enquetePayLoadWeb.getParcelleId() == null) {
|
||||||
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
|
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
|
||||||
|
} else {
|
||||||
|
optionalParcelle = parcelleService.getParcelleById(enquetePayLoadWeb.getParcelleId());
|
||||||
}
|
}
|
||||||
Enquete enquete = entityFromPayLoadService.getEnqueteFromPayLoadWeb(enquetePayLoadWeb);
|
|
||||||
////enregistrement de l'enquete
|
|
||||||
|
|
||||||
|
////enregistrement de l'enquete
|
||||||
|
Enquete enquete = new Enquete();
|
||||||
|
enquete.setDateEnquete(LocalDate.now());
|
||||||
|
enquete.setUser(optionalUser.get());
|
||||||
|
enquete.setParcelle(optionalParcelle.get());
|
||||||
|
enquete.setLitige(enquetePayLoadWeb.getLitige());
|
||||||
|
enquete.setStatutEnquete(StatutEnquete.EN_COURS);
|
||||||
|
enquete.setObservationParticuliere(enquetePayLoadWeb.getObservation());
|
||||||
|
enquete.setPersonne(optionalPersonne.orElse(null));
|
||||||
|
enquete.setZoneRfu(optionalZoneRfu.orElse(null));
|
||||||
|
enquete.setAutreAdresse(enquetePayLoadWeb.getAutreAdresse());
|
||||||
|
enquete.setAutreNumeroTitreFoncier(enquetePayLoadWeb.getAutreNumeroTitreFoncier());
|
||||||
|
enquete.setNumeroTitreFoncier(enquetePayLoadWeb.getNumeroTitreFoncier());
|
||||||
|
enquete.setDateDebutExcemption(enquetePayLoadWeb.getDateDebutExemption());
|
||||||
|
enquete.setDateFinExcemption(enquetePayLoadWeb.getDateFinExemption());
|
||||||
|
enquete.setNbreBatiment(enquetePayLoadWeb.getNbreBatiment());
|
||||||
|
enquete.setNbrePiscine(enquetePayLoadWeb.getNbrePiscine());
|
||||||
|
enquete.setNbreIndivisiaire(enquetePayLoadWeb.getNbreIndivisiaire());
|
||||||
|
enquete.setNbreCoProprietaire(enquetePayLoadWeb.getNbreCoProprietaire());
|
||||||
|
enquete.setNumEntreeParcelle(enquetePayLoadWeb.getNumEntreeParcelle());
|
||||||
|
enquete.setNomRue(enquetePayLoadWeb.getNomRue());
|
||||||
|
enquete.setNumRue(enquetePayLoadWeb.getNumRue());
|
||||||
|
enquete.setSuperficie(enquetePayLoadWeb.getSuperficie());
|
||||||
|
enquete.setMontantMensuelleLocation(enquetePayLoadWeb.getMontantMensuelleLocation());
|
||||||
|
enquete.setMontantAnnuelleLocation(enquetePayLoadWeb.getMontantAnnuelleLocation());
|
||||||
|
enquete.setValeurParcelleEstime(enquetePayLoadWeb.getValeurParcelleEstime());
|
||||||
|
enquete.setValeurParcelleReel(enquetePayLoadWeb.getValeurParcelleReel());
|
||||||
enquete=enqueteRepository.save(enquete);
|
enquete=enqueteRepository.save(enquete);
|
||||||
|
|
||||||
//////Enregistrement des caractéristiques parcelle
|
//////Enregistrement des caractéristiques parcelle
|
||||||
@@ -152,11 +175,11 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
|
|
||||||
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
|
return enquete;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnquetePayLoadWeb updateEnquete(Long id,EnquetePayLoadWeb enquetePayLoadWeb) throws NotFoundException {
|
public Enquete updateEnquete(Long id,EnquetePayLoadWeb enquetePayLoadWeb) throws NotFoundException {
|
||||||
if (enquetePayLoadWeb.getId() == null) {
|
if (enquetePayLoadWeb.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une enquête ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une enquête ayant un id null.");
|
||||||
}
|
}
|
||||||
@@ -183,6 +206,16 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
if (!optionalZoneRfu.isPresent()) {
|
if (!optionalZoneRfu.isPresent()) {
|
||||||
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
throw new BadRequestException("Echec de l'enregistrement : zone inexistante");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Optional<Rue> optionalRue = rueRepository.findById(enquetePayLoadWeb.getZoneRfuId());
|
||||||
|
|
||||||
|
// if (optionalRue.isPresent()) {
|
||||||
|
// rueId=optionalRue.get().getId();
|
||||||
|
// enquetePayLoadWeb.getParcellePayLoadWeb().setRueId(rueId);
|
||||||
|
// }
|
||||||
|
|
||||||
|
//Optional<Equipe> optionalEquipe = equipeRepository.findById(enquetePayLoadWeb.getEquipeId());
|
||||||
|
|
||||||
///enregistrement de la pacelle
|
///enregistrement de la pacelle
|
||||||
if (enquetePayLoadWeb.getParcelleId() == null) {
|
if (enquetePayLoadWeb.getParcelleId() == null) {
|
||||||
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
|
throw new ApplicationException("Echec de l'enregistrement : La parcelle non renseignée.");
|
||||||
@@ -190,9 +223,34 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
optionalParcelle = parcelleService.getParcelleById(enquetePayLoadWeb.getParcelleId());
|
optionalParcelle = parcelleService.getParcelleById(enquetePayLoadWeb.getParcelleId());
|
||||||
}
|
}
|
||||||
|
|
||||||
Enquete enquete = entityFromPayLoadService.getEnqueteFromPayLoadWeb(enquetePayLoadWeb);
|
////enregistrement de l'enquete
|
||||||
enquete=enqueteRepository.save(enquete);
|
Enquete enquete = new Enquete();
|
||||||
return enqueteRepository.findEnqueteToDto(enquete.getId()).orElse(null);
|
enquete.setDateEnquete(LocalDate.now());
|
||||||
|
enquete.setUser(optionalUser.get());
|
||||||
|
enquete.setParcelle(optionalParcelle.get());
|
||||||
|
enquete.setLitige(enquetePayLoadWeb.getLitige());
|
||||||
|
enquete.setStatutEnquete(StatutEnquete.EN_COURS);
|
||||||
|
enquete.setObservationParticuliere(enquetePayLoadWeb.getObservation());
|
||||||
|
enquete.setPersonne(optionalProprietaire.orElse(null));
|
||||||
|
enquete.setZoneRfu(optionalZoneRfu.orElse(null));
|
||||||
|
enquete.setAutreAdresse(enquetePayLoadWeb.getAutreAdresse());
|
||||||
|
enquete.setAutreNumeroTitreFoncier(enquetePayLoadWeb.getAutreNumeroTitreFoncier());
|
||||||
|
enquete.setNumeroTitreFoncier(enquetePayLoadWeb.getNumeroTitreFoncier());
|
||||||
|
enquete.setDateDebutExcemption(enquetePayLoadWeb.getDateDebutExemption());
|
||||||
|
enquete.setDateFinExcemption(enquetePayLoadWeb.getDateFinExemption());
|
||||||
|
enquete.setNbreBatiment(enquetePayLoadWeb.getNbreBatiment());
|
||||||
|
enquete.setNbrePiscine(enquetePayLoadWeb.getNbrePiscine());
|
||||||
|
enquete.setNbreIndivisiaire(enquetePayLoadWeb.getNbreIndivisiaire());
|
||||||
|
enquete.setNbreCoProprietaire(enquetePayLoadWeb.getNbreCoProprietaire());
|
||||||
|
enquete.setNumEntreeParcelle(enquetePayLoadWeb.getNumEntreeParcelle());
|
||||||
|
enquete.setNomRue(enquetePayLoadWeb.getNomRue());
|
||||||
|
enquete.setNumRue(enquetePayLoadWeb.getNumRue());
|
||||||
|
enquete.setSuperficie(enquetePayLoadWeb.getSuperficie());
|
||||||
|
enquete.setMontantMensuelleLocation(enquetePayLoadWeb.getMontantMensuelleLocation());
|
||||||
|
enquete.setMontantAnnuelleLocation(enquetePayLoadWeb.getMontantAnnuelleLocation());
|
||||||
|
enquete.setValeurParcelleEstime(enquetePayLoadWeb.getValeurParcelleEstime());
|
||||||
|
enquete.setValeurParcelleReel(enquetePayLoadWeb.getValeurParcelleReel());
|
||||||
|
return enqueteRepository.save(enquete);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -309,29 +367,24 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<EnquetePayLoadWeb> getEnqueteList(Pageable pageable) {
|
public Page<Enquete> getEnqueteList(Pageable pageable) {
|
||||||
return enqueteRepository.findAllEnquetesToDtoPageable(pageable);
|
return enqueteRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnquetePayLoadWeb> getEnqueteList() {
|
public List<Enquete> getEnqueteList() {
|
||||||
return enqueteRepository.findAllEnquetesToDto();
|
return enqueteRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EnquetePayLoadWeb> getEnqueteListByParcelle(Long parcelleId) {
|
public List<Enquete> getEnqueteListByParcelle(Long parcelleId) {
|
||||||
return enqueteRepository.findAllEnquetesByParcelleToDto(parcelleId);
|
return enqueteRepository.findAllByParcelle_Id(parcelleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<EnquetePayLoadWeb> getEnqueteListByParcellePageable(Long parcelleId, Pageable pageable) {
|
public Optional<Enquete> getEnqueteById(Long id) {
|
||||||
return enqueteRepository.findAllEnquetesByParcelleToDtoPageable(parcelleId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<EnquetePayLoadWeb> getEnqueteById(Long id) {
|
|
||||||
if (enqueteRepository.existsById(id)) {
|
if (enqueteRepository.existsById(id)) {
|
||||||
return enqueteRepository.findEnqueteToDto(id);
|
return enqueteRepository.findById(id);
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException("Impossible de trouver l'enquête.");
|
throw new NotFoundException("Impossible de trouver l'enquête.");
|
||||||
}
|
}
|
||||||
@@ -349,7 +402,7 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
Enquete enquete = optionalEnquete.get();
|
Enquete enquete = optionalEnquete.get();
|
||||||
enquete.setDateValidation(LocalDate.now());
|
enquete.setDateValidation(LocalDate.now());
|
||||||
enquete.setStatutEnquete(StatutEnquete.VALIDE);
|
enquete.setStatutEnquete(StatutEnquete.VALIDE);
|
||||||
enquete.setSynchronise(true);
|
enquete.setSynchronise(false);
|
||||||
return enqueteRepository.save(enquete);
|
return enqueteRepository.save(enquete);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,26 +595,4 @@ public class EnqueteServiceImpl implements EnqueteService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public int cloturerEnqueteParcelleBatimentUniteLogementByUserIdAndExerciceId(Long userId,Long exerciceId) {
|
|
||||||
Optional<User> optionalUser= userRepository.findById(userId);
|
|
||||||
int nbreEnquete=0;
|
|
||||||
if(optionalUser.isPresent() && optionalUser.get().getStructure()!=null){
|
|
||||||
Long structureId=optionalUser.get().getStructure().getId();
|
|
||||||
nbreEnquete=cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(structureId,exerciceId);
|
|
||||||
}
|
|
||||||
return nbreEnquete;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public int cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(Long structureId,Long exerciceId) {
|
|
||||||
Integer nombreParcelleImpacte=enqueteRepository.clotureEnqueteParcelle(structureId,exerciceId);
|
|
||||||
Integer nombreBatiment=enqueteBatimentRepository.clotureEnqueteBatiment(structureId,exerciceId);
|
|
||||||
Integer nombreUniteLogement=enqueteUniteLogementRepository.clotureEnqueteUniteLogement(structureId,exerciceId);
|
|
||||||
return nombreParcelleImpacte;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import io.gmss.fiscad.entities.infocad.metier.Upload;
|
|||||||
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.metier.ParcelleGeomService;
|
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleGeomService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.ParcelleGeomPaylaodWeb;
|
|
||||||
import io.gmss.fiscad.paylaods.response.EnqueteCheckResponse;
|
import io.gmss.fiscad.paylaods.response.EnqueteCheckResponse;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleGeomRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.metier.ParcelleGeomRepository;
|
||||||
@@ -80,7 +79,6 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Upload saveGeoJsonUpload(MultipartFile file,String reference,String desc) {
|
private Upload saveGeoJsonUpload(MultipartFile file,String reference,String desc) {
|
||||||
Upload upload = new Upload();
|
Upload upload = new Upload();
|
||||||
String fileName = fileStorageService.storeFile(file);
|
String fileName = fileStorageService.storeFile(file);
|
||||||
@@ -178,16 +176,6 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
|
|||||||
return parcelleGeomRepository.findAllByQuartier_Code(codeQuartier);
|
return parcelleGeomRepository.findAllByQuartier_Code(codeQuartier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierId(Long quartierId) {
|
|
||||||
return parcelleGeomRepository.findAllByQuartierId(quartierId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierIdPaged(Long quartierId, Pageable pageable) {
|
|
||||||
return parcelleGeomRepository.findAllByQuartierIdPageable(quartierId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement) {
|
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement) {
|
||||||
return parcelleGeomRepository.findAllByQuartier_Arrondissement_Code(codeArrondissement);
|
return parcelleGeomRepository.findAllByQuartier_Arrondissement_Code(codeArrondissement);
|
||||||
@@ -274,9 +262,4 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int createParcelleGeomFromGeoJsonApi() throws BadRequestException {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.gmss.fiscad.exceptions.BadRequestException;
|
|||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
import io.gmss.fiscad.exceptions.NotFoundException;
|
||||||
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
|
import io.gmss.fiscad.interfaces.decoupage.SecteurService;
|
||||||
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleService;
|
import io.gmss.fiscad.interfaces.infocad.metier.ParcelleService;
|
||||||
import io.gmss.fiscad.paylaods.FiltreParcelle;
|
|
||||||
import io.gmss.fiscad.paylaods.request.FiltreParcellePayLoad;
|
import io.gmss.fiscad.paylaods.request.FiltreParcellePayLoad;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
|
||||||
import io.gmss.fiscad.paylaods.response.dataTableResponse.ParcelleDataTableResponse;
|
import io.gmss.fiscad.paylaods.response.dataTableResponse.ParcelleDataTableResponse;
|
||||||
@@ -22,7 +21,6 @@ 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;
|
||||||
@@ -49,7 +47,7 @@ public class ParcelleServiceImpl implements ParcelleService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParcellePayLoadWeb createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException {
|
public Parcelle createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException {
|
||||||
Optional<NatureDomaine> optionalNatureDomaine = natureDomaineRepository.findById(parcellePayLoadWeb.getNatureDomaineId());
|
Optional<NatureDomaine> optionalNatureDomaine = natureDomaineRepository.findById(parcellePayLoadWeb.getNatureDomaineId());
|
||||||
if (!optionalNatureDomaine.isPresent()) {
|
if (!optionalNatureDomaine.isPresent()) {
|
||||||
throw new BadRequestException("Impossible d'enregistrer une parcelle avec une nature de domaine inexistant");
|
throw new BadRequestException("Impossible d'enregistrer une parcelle avec une nature de domaine inexistant");
|
||||||
@@ -62,12 +60,11 @@ public class ParcelleServiceImpl implements ParcelleService {
|
|||||||
parcelle.setNatureDomaine(optionalNatureDomaine.orElse(null));
|
parcelle.setNatureDomaine(optionalNatureDomaine.orElse(null));
|
||||||
parcelle.setQuartier(optionalQuartier.orElse(null));
|
parcelle.setQuartier(optionalQuartier.orElse(null));
|
||||||
parcelle = getParcelleFromPayload(parcelle, parcellePayLoadWeb);
|
parcelle = getParcelleFromPayload(parcelle, parcellePayLoadWeb);
|
||||||
parcelle= parcelleRepository.save(parcelle);
|
return parcelleRepository.save(parcelle);
|
||||||
return parcelleRepository.findParcelleToDtoById(parcelle.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ParcellePayLoadWeb updateParcelle(Long id, ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException {
|
public Parcelle updateParcelle(Long id, ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException {
|
||||||
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(parcellePayLoadWeb.getId());
|
Optional<Parcelle> optionalParcelle = parcelleRepository.findById(parcellePayLoadWeb.getId());
|
||||||
if (!optionalParcelle.isPresent()) {
|
if (!optionalParcelle.isPresent()) {
|
||||||
throw new NotFoundException("Impossible de trouver la parcelle que vous désirer modifier");
|
throw new NotFoundException("Impossible de trouver la parcelle que vous désirer modifier");
|
||||||
@@ -88,8 +85,7 @@ public class ParcelleServiceImpl implements ParcelleService {
|
|||||||
parcelle.setNatureDomaine(optionalNatureDomaine.orElse(null));
|
parcelle.setNatureDomaine(optionalNatureDomaine.orElse(null));
|
||||||
parcelle.setQuartier(optionalQuartier.orElse(null));
|
parcelle.setQuartier(optionalQuartier.orElse(null));
|
||||||
parcelle = getParcelleFromPayload(optionalParcelle.get(), parcellePayLoadWeb);
|
parcelle = getParcelleFromPayload(optionalParcelle.get(), parcellePayLoadWeb);
|
||||||
parcelle= parcelleRepository.save(parcelle);
|
return parcelleRepository.save(parcelle);
|
||||||
return parcelleRepository.findParcelleToDtoById(parcelle.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -178,29 +174,14 @@ public class ParcelleServiceImpl implements ParcelleService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<ParcellePayLoadWeb> getParcelleByMultiFiltre(Long userId, FiltreParcelle filtreParcelle, Pageable pageable) {
|
public Page<ParcelleDataTableResponse> getParcelleDataTableListByUserId(Long userId, Pageable pageable) {
|
||||||
List<Long> secteurIds = getSecteurIdListForUser(userId);
|
List<Long> secteurIds = getSecteurIdListForUser(userId);
|
||||||
System.out.println(secteurIds.size());
|
Page<ParcelleDataTableResponse> parcelleDataTableResponses=parcelleRepository.getParcelleDataTableResponse(secteurIds,pageable);
|
||||||
if (secteurIds == null || secteurIds.isEmpty()) {
|
|
||||||
throw new IllegalArgumentException("Vous n'êtes pas autorisés à consulter ces parcelles");
|
|
||||||
}
|
|
||||||
return parcelleRepository.filtrerParcellesNative(
|
|
||||||
filtreParcelle,
|
|
||||||
secteurIds,
|
|
||||||
pageable
|
|
||||||
);
|
|
||||||
|
|
||||||
|
return parcelleDataTableResponses ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@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()
|
||||||
@@ -209,8 +190,22 @@ public class ParcelleServiceImpl implements ParcelleService {
|
|||||||
return secteurIds;
|
return secteurIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ParcelleDataTableResponse> getParcelleDataTableListByMultiFiltre(Long userId, FiltreParcellePayLoad filtreParcellePayLoad, Pageable pageable) {
|
||||||
|
List<Long> secteurIds = getSecteurIdListForUser(userId);
|
||||||
|
//
|
||||||
|
// return parcelleRepository.findAll(
|
||||||
|
// ParcelleSpecification.filtre(filtreParcellePayLoad, secteurIds),
|
||||||
|
// pageable
|
||||||
|
// );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Page<ParcelleDataTableResponse> parcelleDataTableResponses=parcelleRepository.getParcelleDataTableResponse(secteurIds,pageable);
|
||||||
|
|
||||||
|
return parcelleDataTableResponses ;
|
||||||
|
}
|
||||||
|
|
||||||
private Parcelle getParcelleFromPayload(Parcelle parcelle, ParcellePayLoadWeb parcellePayLoadWeb) {
|
private Parcelle getParcelleFromPayload(Parcelle parcelle, ParcellePayLoadWeb parcellePayLoadWeb) {
|
||||||
if(parcellePayLoadWeb.getRueId()!=null) {
|
if(parcellePayLoadWeb.getRueId()!=null) {
|
||||||
Optional<Rue> optionalRue = rueRepository.findById(parcellePayLoadWeb.getRueId());
|
Optional<Rue> optionalRue = rueRepository.findById(parcellePayLoadWeb.getRueId());
|
||||||
|
|||||||
@@ -2,17 +2,12 @@ package io.gmss.fiscad.implementations.infocad.metier;
|
|||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.parametre.*;
|
import io.gmss.fiscad.entities.infocad.parametre.*;
|
||||||
import io.gmss.fiscad.enums.EtatIdentificationPersonne;
|
|
||||||
import io.gmss.fiscad.enums.Origine;
|
|
||||||
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.metier.PersonneService;
|
import io.gmss.fiscad.interfaces.infocad.metier.PersonneService;
|
||||||
import io.gmss.fiscad.paylaods.dto.*;
|
import io.gmss.fiscad.paylaods.dto.*;
|
||||||
import io.gmss.fiscad.paylaods.request.IfuEnLigneRechercheBody;
|
|
||||||
import io.gmss.fiscad.paylaods.request.RecherchePersonneResquestBody;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.PersonnePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.PersonnePayLoadWeb;
|
||||||
import io.gmss.fiscad.paylaods.response.ifuenligne.IfuEnLigneContribuableResponse;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.decoupage.CommuneRepository;
|
import io.gmss.fiscad.persistence.repositories.decoupage.CommuneRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.decoupage.NationaliteRepository;
|
import io.gmss.fiscad.persistence.repositories.decoupage.NationaliteRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.MembreGroupeRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.metier.MembreGroupeRepository;
|
||||||
@@ -22,7 +17,6 @@ import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneReposit
|
|||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.ProfessionRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.parametre.ProfessionRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.SituationMatrimonialeRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.parametre.SituationMatrimonialeRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.TypePersonneRepository;
|
import io.gmss.fiscad.persistence.repositories.infocad.parametre.TypePersonneRepository;
|
||||||
import io.gmss.fiscad.service.CallAPIService;
|
|
||||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
||||||
import jakarta.persistence.EntityNotFoundException;
|
import jakarta.persistence.EntityNotFoundException;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -30,13 +24,9 @@ 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.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.time.ZoneId;
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PersonneServiceImpl implements PersonneService {
|
public class PersonneServiceImpl implements PersonneService {
|
||||||
@@ -51,19 +41,26 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
private final ProfessionRepository professionRepository;
|
private final ProfessionRepository professionRepository;
|
||||||
private final SituationMatrimonialeRepository situationMatrimonialeRepository;
|
private final SituationMatrimonialeRepository situationMatrimonialeRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
private final EntityFromPayLoadService entityFromPayLoadService;
|
||||||
private final CallAPIService callAPIService;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PersonnePayLoadWeb createPersonne(PersonnePayLoadWeb personnePayLoadWeb) throws BadRequestException {
|
public Personne createPersonne(PersonnePayLoadWeb personnePayLoadWeb) throws BadRequestException {
|
||||||
|
// Optional<TypePersonne> optionalTypePersonne = typePersonneRepository.findById(personnePayLoadWeb.getTypePersonneId());
|
||||||
|
//
|
||||||
|
// Optional<Commune> optionalCommune = communeRepository.findById(personnePayLoadWeb.getCommuneId());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Optional<Nationalite> optionalNationalite = nationaliteRepository.findById(personnePayLoadWeb.getNationaliteId());
|
||||||
|
//
|
||||||
|
// Optional<SituationMatrimoniale> optionalQuartier = situationMatrimonialeRepository.findById(personnePayLoadWeb.getSituationMatrimonialeId());
|
||||||
|
//
|
||||||
|
// Optional<Profession> optionalProfession = professionRepository.findById(personnePayLoadWeb.getProfessionId());
|
||||||
|
//
|
||||||
Personne personne = entityFromPayLoadService.getPersonneFromPayLoadWeb(personnePayLoadWeb);
|
Personne personne = entityFromPayLoadService.getPersonneFromPayLoadWeb(personnePayLoadWeb);
|
||||||
personne =personneRepository.save(personne);
|
return personneRepository.save(personne);
|
||||||
return personneRepository.findBypersonneId(personne.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PersonnePayLoadWeb updatePersonne(Long id, PersonnePayLoadWeb personnePayLoadWeb) throws NotFoundException {
|
public Personne updatePersonne(Long id, PersonnePayLoadWeb personnePayLoadWeb) throws NotFoundException {
|
||||||
if (personnePayLoadWeb.getId() == null) {
|
if (personnePayLoadWeb.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une enquête ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une enquête ayant un id null.");
|
||||||
}
|
}
|
||||||
@@ -72,8 +69,7 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Personne personne = entityFromPayLoadService.getPersonneFromPayLoadWeb(personnePayLoadWeb);
|
Personne personne = entityFromPayLoadService.getPersonneFromPayLoadWeb(personnePayLoadWeb);
|
||||||
personne =personneRepository.save(personne);
|
return personneRepository.save(personne);
|
||||||
return personneRepository.findBypersonneId(personne.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -82,18 +78,18 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PersonnePayLoadWeb> getPersonneList(Pageable pageable) {
|
public Page<Personne> getPersonneList(Pageable pageable) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PersonnePayLoadWeb> getPersonneList() {
|
public List<Personne> getPersonneList() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<PersonnePayLoadWeb> getPersonneById(Long id) {
|
public Optional<Personne> getPersonneById(Long id) {
|
||||||
return personneRepository.findBypersonneId(id);
|
return personneRepository.findById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -193,165 +189,5 @@ public class PersonneServiceImpl implements PersonneService {
|
|||||||
membres
|
membres
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public List<PersonnePayLoadWeb> recherchePersonne(RecherchePersonneResquestBody recherchePersonneResquestBody) {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// List<PersonnePayLoadWeb> personnePayLoadWebsRfuLoggil = new ArrayList<>();
|
|
||||||
// personnePayLoadWebsRfuLoggil = recherchePersonneLocal(recherchePersonneResquestBody);
|
|
||||||
//
|
|
||||||
// try{
|
|
||||||
//
|
|
||||||
// LocalDate date = recherchePersonneResquestBody.getDateNaissance();
|
|
||||||
// String dateNaissance = date != null
|
|
||||||
// ? date.format(DateTimeFormatter.ISO_LOCAL_DATE)
|
|
||||||
// : null;
|
|
||||||
//
|
|
||||||
// IfuEnLigneRechercheBody ifuEnLigneRechercheBody =new IfuEnLigneRechercheBody();
|
|
||||||
// // ifuEnLigneRechercheBody.setIfu(recherchePersonneResquestBody.getIfu());
|
|
||||||
// ifuEnLigneRechercheBody.setNom(recherchePersonneResquestBody.getNom());
|
|
||||||
// ifuEnLigneRechercheBody.setPrenom(recherchePersonneResquestBody.getPrenom());
|
|
||||||
// ifuEnLigneRechercheBody.setDateNaissance(dateNaissance);
|
|
||||||
//
|
|
||||||
// List<IfuEnLigneContribuableResponse> ifuEnLigneContribuableResponses =callAPIService.callApiRechercheContribIfuEnLigne(ifuEnLigneRechercheBody);
|
|
||||||
// System.out.println(ifuEnLigneContribuableResponses);
|
|
||||||
// if(ifuEnLigneContribuableResponses!=null && !ifuEnLigneContribuableResponses.isEmpty()){
|
|
||||||
// //List<PersonnePayLoadWeb> finalPersonnePayLoadWebsRfuLoggil = personnePayLoadWebsRfuLoggil;
|
|
||||||
// ifuEnLigneContribuableResponses.forEach(ifuEnLigneContribuableResponse -> {
|
|
||||||
// PersonnePayLoadWeb personnePayLoadWeb=new PersonnePayLoadWeb();
|
|
||||||
// personnePayLoadWeb.setSource(Origine.SIGIBE);
|
|
||||||
// personnePayLoadWeb.setNpi(ifuEnLigneContribuableResponse.getNpi());
|
|
||||||
// personnePayLoadWeb.setIfu(ifuEnLigneContribuableResponse.getIfu());
|
|
||||||
// personnePayLoadWeb.setNomMere(ifuEnLigneContribuableResponse.getMotherlastname());
|
|
||||||
// personnePayLoadWeb.setNom(ifuEnLigneContribuableResponse.getLastname());
|
|
||||||
// personnePayLoadWeb.setPrenom(ifuEnLigneContribuableResponse.getFirstname());
|
|
||||||
// personnePayLoadWeb.setPrenomMere(ifuEnLigneContribuableResponse.getBjmotherfirstname());
|
|
||||||
//
|
|
||||||
// Date birthdate = ifuEnLigneContribuableResponse.getBirthdate();
|
|
||||||
// LocalDate localDate = birthdate != null
|
|
||||||
// ? birthdate.toInstant()
|
|
||||||
// .atZone(ZoneId.systemDefault())
|
|
||||||
// .toLocalDate()
|
|
||||||
// : null;
|
|
||||||
// personnePayLoadWeb.setDateNaissanceOuConsti(localDate);
|
|
||||||
// personnePayLoadWeb.setTel1(ifuEnLigneContribuableResponse.getPhonenumber());
|
|
||||||
// personnePayLoadWeb.setLieuNaissance(ifuEnLigneContribuableResponse.getBirthplace());
|
|
||||||
// personnePayLoadWeb.setSexe(ifuEnLigneContribuableResponse.getSexe());
|
|
||||||
//
|
|
||||||
// personnePayLoadWebsRfuLoggil.add(personnePayLoadWeb);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }catch (Exception e){
|
|
||||||
// e.printStackTrace();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return personnePayLoadWebsRfuLoggil;
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<PersonnePayLoadWeb> recherchePersonne(RecherchePersonneResquestBody request) {
|
|
||||||
|
|
||||||
List<PersonnePayLoadWeb> result = new ArrayList<>(
|
|
||||||
recherchePersonneLocal(request)
|
|
||||||
);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Conversion date en String format yyyy-MM-dd
|
|
||||||
String dateNaissance = Optional.ofNullable(request.getDateNaissance())
|
|
||||||
.map(d -> d.format(DateTimeFormatter.ISO_LOCAL_DATE))
|
|
||||||
.orElse(null);
|
|
||||||
// Construction du body IFU
|
|
||||||
IfuEnLigneRechercheBody ifuRequest = new IfuEnLigneRechercheBody();
|
|
||||||
ifuRequest.setNom(request.getNom());
|
|
||||||
ifuRequest.setPrenom(request.getPrenom());
|
|
||||||
ifuRequest.setDateNaissance(dateNaissance);
|
|
||||||
|
|
||||||
List<IfuEnLigneContribuableResponse> responses =
|
|
||||||
callAPIService.callApiRechercheContribIfuEnLigne(ifuRequest);
|
|
||||||
|
|
||||||
if (responses == null || responses.isEmpty()) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (IfuEnLigneContribuableResponse r : responses) {
|
|
||||||
|
|
||||||
PersonnePayLoadWeb personne = new PersonnePayLoadWeb();
|
|
||||||
personne.setEtatIdentificationPersonne(EtatIdentificationPersonne.IFU);
|
|
||||||
personne.setNpi(r.getNpi());
|
|
||||||
personne.setIfu(r.getIfu());
|
|
||||||
personne.setNomMere(r.getMotherlastname());
|
|
||||||
personne.setNom(r.getLastname());
|
|
||||||
personne.setPrenom(r.getFirstname());
|
|
||||||
personne.setPrenomMere(r.getBjmotherfirstname());
|
|
||||||
personne.setTel1(r.getPhonenumber());
|
|
||||||
personne.setLieuNaissance(r.getBirthplace());
|
|
||||||
personne.setSexe(r.getSexe());
|
|
||||||
|
|
||||||
// Conversion Date → LocalDate
|
|
||||||
Date birthdate = r.getBirthdate();
|
|
||||||
LocalDate localDate = birthdate != null
|
|
||||||
? birthdate.toInstant()
|
|
||||||
.atZone(ZoneId.systemDefault())
|
|
||||||
.toLocalDate()
|
|
||||||
: null;
|
|
||||||
personne.setDateNaissanceOuConsti(localDate);
|
|
||||||
personne.setEtatIdentificationPersonne(EtatIdentificationPersonne.IFU);
|
|
||||||
result.add(personne);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
// logger.error("Erreur appel IFU EN LIGNE", e);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private List<PersonnePayLoadWeb> recherchePersonneLocal(RecherchePersonneResquestBody recherchePersonneResquestBody) {
|
|
||||||
|
|
||||||
List<PersonnePayLoadWeb> personnePayLoadWebs=
|
|
||||||
personneRepository.findByFiltersInBaseIfuNpiCorrecte(
|
|
||||||
recherchePersonneResquestBody.getIfu()==null?null:recherchePersonneResquestBody.getIfu().trim().toLowerCase(),
|
|
||||||
recherchePersonneResquestBody.getNpi()==null?null:recherchePersonneResquestBody.getNpi().trim().toLowerCase(),
|
|
||||||
recherchePersonneResquestBody.getNom()==null?null:recherchePersonneResquestBody.getNom().trim().toLowerCase(),
|
|
||||||
recherchePersonneResquestBody.getPrenom()==null?null:recherchePersonneResquestBody.getPrenom().trim().toLowerCase(),
|
|
||||||
recherchePersonneResquestBody.getRaisonSociale()==null?null:recherchePersonneResquestBody.getRaisonSociale().trim().toLowerCase(),
|
|
||||||
recherchePersonneResquestBody.getNomMere()==null?null:recherchePersonneResquestBody.getNomMere().trim().toLowerCase(),
|
|
||||||
recherchePersonneResquestBody.getDateNaissance()
|
|
||||||
);
|
|
||||||
return personnePayLoadWebs ;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PersonnePayLoadWeb> recherchePersonneSigibe(RecherchePersonneResquestBody recherchePersonneResquestBody) {
|
|
||||||
// callAPIService.callGetIfuEnLigneToken();
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<PersonnePayLoadWeb> recherchePersonneAnip(RecherchePersonneResquestBody recherchePersonneResquestBody) {
|
|
||||||
// callAPIService.callGetIfuEnLigneToken();
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private String like(String value) {
|
|
||||||
if (value == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
value = value.trim();
|
|
||||||
|
|
||||||
if (value.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "%" + value + "%";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,138 +1,44 @@
|
|||||||
package io.gmss.fiscad.implementations.infocad.metier;
|
package io.gmss.fiscad.implementations.infocad.metier;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Piece;
|
import io.gmss.fiscad.entities.infocad.metier.Piece;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
|
||||||
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.metier.PieceService;
|
import io.gmss.fiscad.interfaces.infocad.metier.PieceService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.PiecePayLoadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.EnqueteRepository;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.PieceRepository;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
|
|
||||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
|
||||||
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.repository.query.Param;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
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 PieceServiceImpl implements PieceService {
|
public class PieceServiceImpl implements PieceService {
|
||||||
private final PieceRepository pieceRepository;
|
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
private final EnqueteRepository enqueteRepository;
|
|
||||||
private final PersonneRepository personneRepository;
|
|
||||||
@Override
|
@Override
|
||||||
public PiecePayLoadWeb createPiece(PiecePayLoadWeb piecePayLoadWeb) throws BadRequestException {
|
public Piece createPiece(Piece piece) throws BadRequestException {
|
||||||
if (piecePayLoadWeb.getId() != null) {
|
return null;
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle déclaration NC ayant un id non null.");
|
|
||||||
}
|
|
||||||
|
|
||||||
Piece piece= entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb);
|
|
||||||
piece =pieceRepository.save(piece);
|
|
||||||
return pieceRepository.findPieceToDto(piece.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PiecePayLoadWeb updatePiece(Long id, PiecePayLoadWeb piecePayLoadWeb) throws NotFoundException {
|
public Piece updatePiece(Long id, Piece piece) throws NotFoundException {
|
||||||
if (piecePayLoadWeb.getId() == null) {
|
return null;
|
||||||
throw new BadRequestException("La piece n'existe pas.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!pieceRepository.existsById(piecePayLoadWeb.getId())) {
|
|
||||||
throw new NotFoundException("La piece n'existe pas");
|
|
||||||
}
|
|
||||||
|
|
||||||
Piece piece= entityFromPayLoadService.getPieceFromPayLoadWeb(piecePayLoadWeb);
|
|
||||||
piece =pieceRepository.save(piece);
|
|
||||||
return pieceRepository.findPieceToDto(piece.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deletePiece(Long id) throws NotFoundException {
|
public void deletePiece(Long id) throws NotFoundException {
|
||||||
Optional<Piece> pieceOptional = pieceRepository.findById(id);
|
|
||||||
if (pieceOptional.isPresent()) {
|
|
||||||
pieceRepository.deleteById(pieceOptional.get().getId());
|
|
||||||
} else {
|
|
||||||
throw new NotFoundException("Impossible de trouver la piece à supprimer .");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PiecePayLoadWeb> getPieceListToDtoPageable(Pageable pageable) {
|
public Page<Piece> getPieceList(Pageable pageable) {
|
||||||
return pieceRepository.findAllToDtoPageable(pageable);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PiecePayLoadWeb> getPieceListToDto() {
|
public List<Piece> getPieceList() {
|
||||||
return pieceRepository.findAllPieceToDto();
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<PiecePayLoadWeb> getPieceByToDto(Long id) {
|
public Optional<Piece> getPieceById(Long id) {
|
||||||
return pieceRepository.findPieceToDto(id);
|
return Optional.empty();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<PiecePayLoadWeb> getAllPieceByEnqueteToDto(Long id) {
|
|
||||||
return pieceRepository.findByFilters(
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
id,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<PiecePayLoadWeb> getAllPieceByEnqueteToDtoPageable(Long id,Pageable pageable) {
|
|
||||||
return pieceRepository.findByFiltersPageable(
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
id,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<PiecePayLoadWeb> getAllPieceByEnqueteBatimentToDto(Long id) {
|
|
||||||
return pieceRepository.findByFilters(
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
id,
|
|
||||||
null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<PiecePayLoadWeb> getAllPieceByEnqueteUniteLogementToDto(Long id) {
|
|
||||||
return pieceRepository.findByFilters(
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
package io.gmss.fiscad.implementations.infocad.metier;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Piece;
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.Batiment;
|
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
|
||||||
import io.gmss.fiscad.interfaces.infocad.metier.UploadService;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.UploadPayLoadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.PieceRepository;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.metier.UploadRepository;
|
|
||||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
|
||||||
import io.gmss.fiscad.service.FileStorageService;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Service
|
|
||||||
public class UploadServiceImpl implements UploadService {
|
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
private final UploadRepository uploadRepository;
|
|
||||||
private final PieceRepository pieceRepository;
|
|
||||||
private final FileStorageService fileStorageService;
|
|
||||||
@Override
|
|
||||||
public UploadPayLoadWeb createUpload(UploadPayLoadWeb uploadPayLoadWeb) throws BadRequestException {
|
|
||||||
if (uploadPayLoadWeb.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer un nouveau upload ayant un id non null.");
|
|
||||||
}
|
|
||||||
Upload upload= entityFromPayLoadService.getUploadFromPayLoadWeb(uploadPayLoadWeb);
|
|
||||||
upload= uploadRepository.save(upload);
|
|
||||||
return uploadRepository.findByIdToDto(upload.getId()).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Upload createUpload(MultipartFile file, @RequestParam Long pieceId) throws BadRequestException {
|
|
||||||
Upload upload = new Upload();
|
|
||||||
if(pieceId!=null && !pieceRepository.existsById(pieceId)) {
|
|
||||||
throw new NotFoundException("La piece n'existe pas");
|
|
||||||
}
|
|
||||||
Optional<Piece> optionalPiece = pieceRepository.findById(pieceId);
|
|
||||||
String fileName = fileStorageService.storeFile(file);
|
|
||||||
upload.setPiece(optionalPiece.orElse(null));
|
|
||||||
upload.setFileName(fileName);
|
|
||||||
upload.setRename(fileName);
|
|
||||||
upload.setMimeType(file.getContentType());
|
|
||||||
upload.setSize(file.getSize());
|
|
||||||
upload.setOriginalFileName(file.getOriginalFilename());
|
|
||||||
upload = uploadRepository.save(upload) ;
|
|
||||||
return upload;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UploadPayLoadWeb updateUpload(Long id, UploadPayLoadWeb uploadPayLoadWeb) throws NotFoundException {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteUpload(Long id) throws NotFoundException {
|
|
||||||
Optional<Upload> optionalUpload = uploadRepository.findById(id);
|
|
||||||
if (optionalUpload.isPresent()) {
|
|
||||||
uploadRepository.deleteById(optionalUpload.get().getId());
|
|
||||||
} else {
|
|
||||||
throw new NotFoundException("Impossible de trouver le fichier spécifié dans notre base de données.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<UploadPayLoadWeb> getUploadListToDtoPageable(Pageable pageable) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UploadPayLoadWeb> getUploadListToDto() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<UploadPayLoadWeb> getUploadByToDto(Long id) {
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UploadPayLoadWeb> getAllUploadByPieceToDto(Long id) {
|
|
||||||
return uploadRepository.findByPieceId(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<UploadPayLoadWeb> getAllUploadByPieceDtoPageable(Long id, Pageable pageable) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Upload> getAllUploadByPiece(Long id) {
|
|
||||||
return uploadRepository.findAllByPiece_Id(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +1,20 @@
|
|||||||
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
|
||||||
@@ -28,7 +23,6 @@ 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 {
|
||||||
@@ -95,29 +89,5 @@ 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;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,43 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.metier;
|
package io.gmss.fiscad.implementations.rfu.metier;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
|
||||||
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.CaracteristiqueBatimentService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueBatimentService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueBatimentPayloadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.CaracteristiqueBatimentRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.CaracteristiqueBatimentRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteBatimentRepository;
|
|
||||||
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;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@AllArgsConstructor
|
|
||||||
@Service
|
@Service
|
||||||
public class CaracteristiqueBatimentServiceImpl implements CaracteristiqueBatimentService {
|
public class CaracteristiqueBatimentServiceImpl implements CaracteristiqueBatimentService {
|
||||||
|
|
||||||
private final CaracteristiqueBatimentRepository caracteristiqueBatimentRepository;
|
private final CaracteristiqueBatimentRepository caracteristiqueBatimentRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
private final EnqueteBatimentRepository enqueteBatimentRepository;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CaracteristiqueBatimentPayloadWeb createCaracteristiqueBatiment(CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) throws BadRequestException {
|
|
||||||
if (caracteristiqueBatimentPayloadWeb.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle caracteristique de batiment ayant un id non null.");
|
|
||||||
}
|
|
||||||
if (!enqueteBatimentRepository.existsById(caracteristiqueBatimentPayloadWeb.getEnqueteBatimentId())) {
|
|
||||||
throw new BadRequestException("Veuillez préciser l'enquete");
|
|
||||||
}
|
|
||||||
|
|
||||||
CaracteristiqueBatiment caracteristiqueBatiment= entityFromPayLoadService.getCaracteristiqueBatimentFromPayLoadWeb(caracteristiqueBatimentPayloadWeb);
|
|
||||||
caracteristiqueBatiment =caracteristiqueBatimentRepository.save(caracteristiqueBatiment);
|
|
||||||
return caracteristiqueBatimentRepository.findCaracteristiqueBatimentToDto(caracteristiqueBatiment.getId()).orElse(null);
|
|
||||||
|
|
||||||
|
public CaracteristiqueBatimentServiceImpl(CaracteristiqueBatimentRepository caracteristiqueBatimentRepository) {
|
||||||
|
this.caracteristiqueBatimentRepository = caracteristiqueBatimentRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CaracteristiqueBatimentPayloadWeb updateCaracteristiqueBatiment(Long id, CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) throws NotFoundException {
|
public CaracteristiqueBatiment createCaracteristiqueBatiment(CaracteristiqueBatiment caracteristiqueBatiment) throws BadRequestException {
|
||||||
if (caracteristiqueBatimentPayloadWeb.getId() == null) {
|
if (caracteristiqueBatiment.getId() != null) {
|
||||||
|
throw new BadRequestException("Impossible de créer une nouvelle caracteristique de batiment ayant un id non null.");
|
||||||
|
}
|
||||||
|
return caracteristiqueBatimentRepository.save(caracteristiqueBatiment);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CaracteristiqueBatiment updateCaracteristiqueBatiment(Long id, CaracteristiqueBatiment caracteristiqueBatiment) throws NotFoundException {
|
||||||
|
if (caracteristiqueBatiment.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique de batiment ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique de batiment ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!caracteristiqueBatimentRepository.existsById(caracteristiqueBatimentPayloadWeb.getId())) {
|
if (!caracteristiqueBatimentRepository.existsById(caracteristiqueBatiment.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique de batiment spécifié dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique de batiment spécifié dans notre base de données.");
|
||||||
}
|
}
|
||||||
CaracteristiqueBatiment caracteristiqueBatiment= entityFromPayLoadService.getCaracteristiqueBatimentFromPayLoadWeb(caracteristiqueBatimentPayloadWeb);
|
return caracteristiqueBatimentRepository.save(caracteristiqueBatiment);
|
||||||
caracteristiqueBatiment =caracteristiqueBatimentRepository.save(caracteristiqueBatiment);
|
|
||||||
return caracteristiqueBatimentRepository.findCaracteristiqueBatimentToDto(caracteristiqueBatiment.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,33 +51,23 @@ public class CaracteristiqueBatimentServiceImpl implements CaracteristiqueBatime
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentList(Pageable pageable) {
|
public Page<CaracteristiqueBatiment> getCaracteristiqueBatimentList(Pageable pageable) {
|
||||||
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentToDtoPageable(pageable);
|
return caracteristiqueBatimentRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentList() {
|
public List<CaracteristiqueBatiment> getCaracteristiqueBatimentList() {
|
||||||
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentToDto();
|
return caracteristiqueBatimentRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentToDto(Long id) {
|
public Optional<CaracteristiqueBatiment> getCaracteristiqueBatimentById(Long id) {
|
||||||
if (caracteristiqueBatimentRepository.existsById(id)) {
|
if (caracteristiqueBatimentRepository.existsById(id)) {
|
||||||
return caracteristiqueBatimentRepository.findCaracteristiqueBatimentToDto(id);
|
return caracteristiqueBatimentRepository.findById(id);
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
|
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentListByEnqueteBatimentPageable(Long enqueteBatimentId, Pageable pageable) {
|
|
||||||
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentByEnqueteBatimentToDtoPageable(enqueteBatimentId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentListByEnqueteBatiment(Long enqueteBatimentId) {
|
|
||||||
return caracteristiqueBatimentRepository.findAllCaracteristiqueBatimentByEnqueteBatimentToDto(enqueteBatimentId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,46 +4,40 @@ import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
|||||||
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.CaracteristiqueParcelleService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueParcelleService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueParcellePayloadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.CaracteristiqueParcelleRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.CaracteristiqueParcelleRepository;
|
||||||
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;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@AllArgsConstructor
|
|
||||||
@Service
|
@Service
|
||||||
public class CaracteristiqueParcelleServiceImpl implements CaracteristiqueParcelleService {
|
public class CaracteristiqueParcelleServiceImpl implements CaracteristiqueParcelleService {
|
||||||
|
|
||||||
private final CaracteristiqueParcelleRepository caracteristiqueParcelleRepository;
|
private final CaracteristiqueParcelleRepository caracteristiqueParcelleRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
|
|
||||||
|
public CaracteristiqueParcelleServiceImpl(CaracteristiqueParcelleRepository caracteristiqueParcelleRepository) {
|
||||||
|
this.caracteristiqueParcelleRepository = caracteristiqueParcelleRepository;
|
||||||
@Override
|
|
||||||
public CaracteristiqueParcellePayloadWeb createCaracteristiqueParcelle(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) throws BadRequestException {
|
|
||||||
if (caracteristiqueParcellePayloadWeb.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle caracteristique de parcelle ayant un id non null.");
|
|
||||||
}
|
|
||||||
CaracteristiqueParcelle caracteristiqueParcelle= entityFromPayLoadService.getCaracteristiqueParcelleFromPayLoadWeb(caracteristiqueParcellePayloadWeb);
|
|
||||||
caracteristiqueParcelle =caracteristiqueParcelleRepository.save(caracteristiqueParcelle);
|
|
||||||
return caracteristiqueParcelleRepository.findCaracteristiqueParcelleToDto(caracteristiqueParcelle.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CaracteristiqueParcellePayloadWeb updateCaracteristiqueParcelle(Long id, CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) throws NotFoundException {
|
public CaracteristiqueParcelle createCaracteristiqueParcelle(CaracteristiqueParcelle caracteristiqueParcelle) throws BadRequestException {
|
||||||
if (caracteristiqueParcellePayloadWeb.getId() == null) {
|
if (caracteristiqueParcelle.getId() != null) {
|
||||||
|
throw new BadRequestException("Impossible de créer une nouvelle caracteristique de parcelle ayant un id non null.");
|
||||||
|
}
|
||||||
|
return caracteristiqueParcelleRepository.save(caracteristiqueParcelle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CaracteristiqueParcelle updateCaracteristiqueParcelle(Long id, CaracteristiqueParcelle caracteristiqueParcelle) throws NotFoundException {
|
||||||
|
if (caracteristiqueParcelle.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique de parcelle ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique de parcelle ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!caracteristiqueParcelleRepository.existsById(caracteristiqueParcellePayloadWeb.getId())) {
|
if (!caracteristiqueParcelleRepository.existsById(caracteristiqueParcelle.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique de parcelle spécifié dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique de parcelle spécifié dans notre base de données.");
|
||||||
}
|
}
|
||||||
CaracteristiqueParcelle caracteristiqueParcelle= entityFromPayLoadService.getCaracteristiqueParcelleFromPayLoadWeb(caracteristiqueParcellePayloadWeb);
|
return caracteristiqueParcelleRepository.save(caracteristiqueParcelle);
|
||||||
caracteristiqueParcelle =caracteristiqueParcelleRepository.save(caracteristiqueParcelle);
|
|
||||||
return caracteristiqueParcelleRepository.findCaracteristiqueParcelleToDto(caracteristiqueParcelle.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -68,22 +62,12 @@ public class CaracteristiqueParcelleServiceImpl implements CaracteristiqueParcel
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CaracteristiqueParcellePayloadWeb> getCaracteristiqueParcelleById(Long id) {
|
public Optional<CaracteristiqueParcelle> getCaracteristiqueParcelleById(Long id) {
|
||||||
if (caracteristiqueParcelleRepository.existsById(id)) {
|
if (caracteristiqueParcelleRepository.existsById(id)) {
|
||||||
return caracteristiqueParcelleRepository.findCaracteristiqueParcelleToDto(id);
|
return caracteristiqueParcelleRepository.findById(id);
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
|
throw new NotFoundException("Impossible de trouver la caractéristique spécifiée dans la base de données.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<CaracteristiqueParcellePayloadWeb> getCaracteristiqueParcelleByEnqueteListPageable(Long id,Pageable pageable) {
|
|
||||||
return caracteristiqueParcelleRepository.findAllCaracteristiqueParcelleByEnqueteToDtoPageable(id,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CaracteristiqueParcellePayloadWeb> getCaracteristiqueParcelleByEnqueteList(Long enqueteId) {
|
|
||||||
return caracteristiqueParcelleRepository.findAllCaracteristiqueParcelleByEnqueteToDto(enqueteId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,43 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.metier;
|
package io.gmss.fiscad.implementations.rfu.metier;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
||||||
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.CaracteristiqueUniteLogementService;
|
import io.gmss.fiscad.interfaces.rfu.metier.CaracteristiqueUniteLogementService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueUniteLogementPayloadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.CaracteristiqueUniteLogementRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.CaracteristiqueUniteLogementRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.EnqueteUniteLogementRepository;
|
|
||||||
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;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@AllArgsConstructor
|
|
||||||
@Service
|
@Service
|
||||||
public class CaracteristiqueUniteLogementServiceImpl implements CaracteristiqueUniteLogementService {
|
public class CaracteristiqueUniteLogementServiceImpl implements CaracteristiqueUniteLogementService {
|
||||||
|
|
||||||
private final CaracteristiqueUniteLogementRepository caracteristiqueUniteLogementRepository;
|
private final CaracteristiqueUniteLogementRepository caracteristiqueUniteLogementRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
private final EnqueteUniteLogementRepository enqueteUniteLogementRepository;
|
|
||||||
|
|
||||||
|
public CaracteristiqueUniteLogementServiceImpl(CaracteristiqueUniteLogementRepository caracteristiqueUniteLogementRepository) {
|
||||||
|
this.caracteristiqueUniteLogementRepository = caracteristiqueUniteLogementRepository;
|
||||||
@Override
|
|
||||||
public CaracteristiqueUniteLogementPayloadWeb createCaracteristiqueUniteLogement(CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) throws BadRequestException {
|
|
||||||
if (caracteristiqueUniteLogementPayloadWeb.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle caracteristique d'unité de logement ayant un id non null.");
|
|
||||||
}
|
|
||||||
if (!enqueteUniteLogementRepository.existsById(caracteristiqueUniteLogementPayloadWeb.getEnqueteUniteLogementId())) {
|
|
||||||
throw new BadRequestException("Veuillez préciser l'enquete.");
|
|
||||||
}
|
|
||||||
|
|
||||||
CaracteristiqueUniteLogement caracteristiqueUniteLogement= entityFromPayLoadService.getCaracteristiqueUniteLogementFromPayLoadWeb(caracteristiqueUniteLogementPayloadWeb);
|
|
||||||
caracteristiqueUniteLogement =caracteristiqueUniteLogementRepository.save(caracteristiqueUniteLogement);
|
|
||||||
return caracteristiqueUniteLogementRepository.findCaracteristiqueUniteLogementToDto(caracteristiqueUniteLogement.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CaracteristiqueUniteLogementPayloadWeb updateCaracteristiqueUniteLogement(Long id, CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) throws NotFoundException {
|
public CaracteristiqueUniteLogement createCaracteristiqueUniteLogement(CaracteristiqueUniteLogement caracteristiqueUniteLogement) throws BadRequestException {
|
||||||
if (caracteristiqueUniteLogementPayloadWeb.getId() == null) {
|
if (caracteristiqueUniteLogement.getId() != null) {
|
||||||
|
throw new BadRequestException("Impossible de créer une nouvelle caracteristique d'unité de logement ayant un id non null.");
|
||||||
|
}
|
||||||
|
return caracteristiqueUniteLogementRepository.save(caracteristiqueUniteLogement);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CaracteristiqueUniteLogement updateCaracteristiqueUniteLogement(Long id, CaracteristiqueUniteLogement caracteristiqueUniteLogement) throws NotFoundException {
|
||||||
|
if (caracteristiqueUniteLogement.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique d'unité de logement ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une nouvelle caracteristique d'unité de logement ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!caracteristiqueUniteLogementRepository.existsById(caracteristiqueUniteLogementPayloadWeb.getId())) {
|
if (!caracteristiqueUniteLogementRepository.existsById(caracteristiqueUniteLogement.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique d'unité de logement spécifiée dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle caracteristique d'unité de logement spécifiée dans notre base de données.");
|
||||||
}
|
}
|
||||||
CaracteristiqueUniteLogement caracteristiqueUniteLogement= entityFromPayLoadService.getCaracteristiqueUniteLogementFromPayLoadWeb(caracteristiqueUniteLogementPayloadWeb);
|
return caracteristiqueUniteLogementRepository.save(caracteristiqueUniteLogement);
|
||||||
caracteristiqueUniteLogement =caracteristiqueUniteLogementRepository.save(caracteristiqueUniteLogement);
|
|
||||||
return caracteristiqueUniteLogementRepository.findCaracteristiqueUniteLogementToDto(caracteristiqueUniteLogement.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -64,33 +51,23 @@ public class CaracteristiqueUniteLogementServiceImpl implements CaracteristiqueU
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementList(Pageable pageable) {
|
public Page<CaracteristiqueUniteLogement> getCaracteristiqueUniteLogementList(Pageable pageable) {
|
||||||
return caracteristiqueUniteLogementRepository.findAllCaracteristiqueUniteLogementToDtoPageable(pageable);
|
return caracteristiqueUniteLogementRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementList() {
|
public List<CaracteristiqueUniteLogement> getCaracteristiqueUniteLogementList() {
|
||||||
return caracteristiqueUniteLogementRepository.findAllCaracteristiqueUniteLogementToDto();
|
return caracteristiqueUniteLogementRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementById(Long id) {
|
public Optional<CaracteristiqueUniteLogement> getCaracteristiqueUniteLogementById(Long id) {
|
||||||
if (caracteristiqueUniteLogementRepository.existsById(id)) {
|
if (caracteristiqueUniteLogementRepository.existsById(id)) {
|
||||||
return caracteristiqueUniteLogementRepository.findCaracteristiqueUniteLogementToDto(id);
|
return caracteristiqueUniteLogementRepository.findById(id);
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException("Impossible de trouver la caracteristique d'unité de logement spécifiée dans la base de données.");
|
throw new NotFoundException("Impossible de trouver la caracteristique d'unité de logement spécifiée dans la base de données.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementListByEul(Long eul, Pageable pageable) {
|
|
||||||
return caracteristiqueUniteLogementRepository.findAllCaracteristiqueUniteLogementByEnqueteUloToDtoPageable(eul,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementListbyEul(Long eul) {
|
|
||||||
return caracteristiqueUniteLogementRepository.findAllCaracteristiqueUniteLogementByEnqueteUloToDto(eul);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,66 +1,43 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.metier;
|
package io.gmss.fiscad.implementations.rfu.metier;
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
|
||||||
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
||||||
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.DeclarationNcService;
|
import io.gmss.fiscad.interfaces.rfu.metier.DeclarationNcService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.DeclarationNcPayloadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.PersonneRepository;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.infocad.parametre.StructureRepository;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.DeclarationNcRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.DeclarationNcRepository;
|
||||||
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;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@AllArgsConstructor
|
|
||||||
@Service
|
@Service
|
||||||
public class DeclarationNcServiceImpl implements DeclarationNcService {
|
public class DeclarationNcServiceImpl implements DeclarationNcService {
|
||||||
|
|
||||||
private final DeclarationNcRepository declarationNcRepository;
|
private final DeclarationNcRepository declarationNcRepository;
|
||||||
private final StructureRepository structureRepository;
|
|
||||||
private final PersonneRepository personneRepository;
|
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
|
|
||||||
|
public DeclarationNcServiceImpl(DeclarationNcRepository declarationNcRepository) {
|
||||||
@Override
|
this.declarationNcRepository = declarationNcRepository;
|
||||||
public DeclarationNcPayloadWeb createDeclarationNc(DeclarationNcPayloadWeb declarationNcPayloadWeb) throws BadRequestException {
|
|
||||||
if (declarationNcPayloadWeb.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle déclaration NC ayant un id non null.");
|
|
||||||
}
|
|
||||||
if (!personneRepository.existsById(declarationNcPayloadWeb.getPersonneId())) {
|
|
||||||
throw new BadRequestException("Veuillez préciser le contribuable.");
|
|
||||||
}
|
|
||||||
if (!structureRepository.existsById(declarationNcPayloadWeb.getStructureId())) {
|
|
||||||
throw new BadRequestException("Veuillez préciser le centre.");
|
|
||||||
}
|
|
||||||
|
|
||||||
DeclarationNc declarationNc= entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb);
|
|
||||||
declarationNc =declarationNcRepository.save(declarationNc);
|
|
||||||
return declarationNcRepository.findDeclarationNcToDto(declarationNc.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeclarationNcPayloadWeb updateDeclarationNc(Long id, DeclarationNcPayloadWeb declarationNcPayloadWeb) throws NotFoundException {
|
public DeclarationNc createDeclarationNc(DeclarationNc declarationNc) throws BadRequestException {
|
||||||
if (declarationNcPayloadWeb.getId() == null) {
|
if (declarationNc.getId() != null) {
|
||||||
|
throw new BadRequestException("Impossible de créer une nouvelle enquete de batiment ayant un id non null.");
|
||||||
|
}
|
||||||
|
return declarationNcRepository.save(declarationNc);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeclarationNc updateDeclarationNc(Long id, DeclarationNc declarationNc) throws NotFoundException {
|
||||||
|
if (declarationNc.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete de batiment ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une nouvelle enquete de batiment ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!declarationNcRepository.existsById(declarationNcPayloadWeb.getId())) {
|
if (!declarationNcRepository.existsById(declarationNc.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle enquete de batiment spécifiée dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle enquete de batiment spécifiée dans notre base de données.");
|
||||||
}
|
}
|
||||||
if (!personneRepository.existsById(declarationNcPayloadWeb.getPersonneId())) {
|
return declarationNcRepository.save(declarationNc);
|
||||||
throw new BadRequestException("Veuillez préciser le contribuable.");
|
|
||||||
}
|
|
||||||
if (!structureRepository.existsById(declarationNcPayloadWeb.getStructureId())) {
|
|
||||||
throw new BadRequestException("Veuillez préciser le centre.");
|
|
||||||
}
|
|
||||||
DeclarationNc declarationNc= entityFromPayLoadService.getDeclarationNcFromPayLoadWeb(declarationNcPayloadWeb);
|
|
||||||
declarationNc =declarationNcRepository.save(declarationNc);
|
|
||||||
return declarationNcRepository.findDeclarationNcToDto(declarationNc.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -74,36 +51,23 @@ public class DeclarationNcServiceImpl implements DeclarationNcService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DeclarationNcPayloadWeb> getDeclarationNcList(Pageable pageable) {
|
public Page<DeclarationNc> getDeclarationNcList(Pageable pageable) {
|
||||||
return declarationNcRepository.findAllDeclarationNcToDtoPageable(pageable);
|
return declarationNcRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeclarationNcPayloadWeb> getDeclarationNcList() {
|
public List<DeclarationNc> getDeclarationNcList() {
|
||||||
return declarationNcRepository.findAllDeclarationNcToDto();
|
return declarationNcRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<DeclarationNcPayloadWeb> getDeclarationNcById(Long id) {
|
public Optional<DeclarationNc> getDeclarationNcById(Long id) {
|
||||||
if (declarationNcRepository.existsById(id)) {
|
if (declarationNcRepository.existsById(id)) {
|
||||||
return declarationNcRepository.findDeclarationNcToDto(id);
|
return declarationNcRepository.findById(id);
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException("Impossible de trouver la nouvelle enquete de batiment spécifiée dans la base de données.");
|
throw new NotFoundException("Impossible de trouver la nouvelle enquete de batiment spécifiée dans la base de données.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<DeclarationNcPayloadWeb> getDeclarationNcByPersonneList(Long personneId, Pageable pageable) {
|
|
||||||
return declarationNcRepository.findAllDeclarationNcByPersonneToDtoPageable(personneId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DeclarationNcPayloadWeb> getDeclarationNcByPersonneList(Long personneId) {
|
|
||||||
return declarationNcRepository.findAllDeclarationNcByPersonneToDto(personneId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,9 @@ import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
|||||||
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.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.DonneesImpositionTfuService;
|
import io.gmss.fiscad.interfaces.rfu.metier.DonneesImpositionTfuService;
|
||||||
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;
|
||||||
@@ -18,7 +15,6 @@ import io.gmss.fiscad.persistence.repositories.rfu.metier.DonneesImpositionTfuRe
|
|||||||
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.metier.ImpositionsTfuRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.ExerciceRepository;
|
||||||
import io.gmss.fiscad.service.EntityFromPayLoadService;
|
|
||||||
import jakarta.transaction.Transactional;
|
import jakarta.transaction.Transactional;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.dao.DataIntegrityViolationException;
|
import org.springframework.dao.DataIntegrityViolationException;
|
||||||
@@ -40,7 +36,6 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
private final BaremRfuNonBatiRepository baremRfuNonBatiRepository;
|
private final BaremRfuNonBatiRepository baremRfuNonBatiRepository;
|
||||||
private final ExerciceRepository exerciceRepository;
|
private final ExerciceRepository exerciceRepository;
|
||||||
private final ArrondissementRepository arrondissementRepository;
|
private final ArrondissementRepository arrondissementRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -96,43 +91,91 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleNonBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) {
|
public Long genererDonneesFiscales(ImpositionsTfu impositionsTfu) {
|
||||||
Integer nb= donneesImpositionTfuRepository.genererDonneesTfuNonBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
List<DonneesImpositionTfuResponse> donneesImpositionTfuResponses= donneesImpositionTfuRepository.findAllDonneesImpositionTfu(impositionsTfu.getCommune().getId(),impositionsTfu.getExercice().getAnnee());
|
||||||
|
Long n=0l;
|
||||||
|
for (DonneesImpositionTfuResponse donneesImpositionTfuResponse: donneesImpositionTfuResponses){
|
||||||
|
DonneesImpositionTfu donneesImpositionTfu=new DonneesImpositionTfu();
|
||||||
|
donneesImpositionTfu.setImpositionsTfu(impositionsTfu);
|
||||||
|
donneesImpositionTfu.setZoneRfuId(donneesImpositionTfuResponse.getZoneRfuId());
|
||||||
|
donneesImpositionTfu.setCodeQuartierVillage(donneesImpositionTfuResponse.getCodeQuartierVillage());
|
||||||
|
donneesImpositionTfu.setNomQuartierVillage(donneesImpositionTfuResponse.getNomQuartierVillage());
|
||||||
|
donneesImpositionTfu.setCodeArrondissement(donneesImpositionTfuResponse.getCodeArrondissement());
|
||||||
|
donneesImpositionTfu.setNomArrondissement(donneesImpositionTfuResponse.getNomArrondissement());
|
||||||
|
donneesImpositionTfu.setCodeCommune(donneesImpositionTfuResponse.getCodeCommune());
|
||||||
|
donneesImpositionTfu.setNomCommune(donneesImpositionTfuResponse.getNomCommune());
|
||||||
|
donneesImpositionTfu.setCodeDepartement(donneesImpositionTfuResponse.getCodeDepartement());
|
||||||
|
donneesImpositionTfu.setNomDepartement(donneesImpositionTfuResponse.getNomDepartement());
|
||||||
|
donneesImpositionTfu.setQ(donneesImpositionTfuResponse.getQ());
|
||||||
|
donneesImpositionTfu.setIlot(donneesImpositionTfuResponse.getIlot());
|
||||||
|
donneesImpositionTfu.setParcelle(donneesImpositionTfuResponse.getParcelle());
|
||||||
|
donneesImpositionTfu.setLatitude(donneesImpositionTfuResponse.getLatitude());
|
||||||
|
donneesImpositionTfu.setLongitude(donneesImpositionTfuResponse.getLongitude());
|
||||||
|
donneesImpositionTfu.setNup(donneesImpositionTfuResponse.getNup());
|
||||||
|
donneesImpositionTfu.setNupProvisoire(donneesImpositionTfuResponse.getNupProvisoire());
|
||||||
|
donneesImpositionTfu.setSuperficieParc(donneesImpositionTfuResponse.getSuperficieParc());
|
||||||
|
donneesImpositionTfu.setAdresseProp(donneesImpositionTfuResponse.getAdresseProp());
|
||||||
|
donneesImpositionTfu.setAnnee(donneesImpositionTfuResponse.getAnnee());
|
||||||
|
donneesImpositionTfu.setAdresseSc(donneesImpositionTfuResponse.getAdresseSc());
|
||||||
|
donneesImpositionTfu.setBatieOuiNon(donneesImpositionTfuResponse.getBatieOuiNon());
|
||||||
|
donneesImpositionTfu.setTfuMinimum(donneesImpositionTfuResponse.getTfuMinimum());
|
||||||
|
donneesImpositionTfu.setCategorieBat(donneesImpositionTfuResponse.getCategorieBat());
|
||||||
|
donneesImpositionTfu.setDateEnquete(donneesImpositionTfuResponse.getDateEnquete());
|
||||||
|
donneesImpositionTfu.setEmailProp(donneesImpositionTfuResponse.getEmailProp());
|
||||||
|
donneesImpositionTfu.setEmailSc(donneesImpositionTfuResponse.getEmailSc());
|
||||||
|
donneesImpositionTfu.setMontantLoyerAnnuel(donneesImpositionTfuResponse.getMontantLoyerAnnuel());
|
||||||
|
donneesImpositionTfu.setEnqueteId(donneesImpositionTfuResponse.getEnqueteId());
|
||||||
|
donneesImpositionTfu.setExhonereOuiNon(donneesImpositionTfuResponse.getExhonereOuiNon());
|
||||||
|
donneesImpositionTfu.setIfu(donneesImpositionTfuResponse.getIfu());
|
||||||
|
donneesImpositionTfu.setNombreBat(donneesImpositionTfuResponse.getNombreBat());
|
||||||
|
donneesImpositionTfu.setNombrePiscine(donneesImpositionTfuResponse.getNombrePiscine());
|
||||||
|
donneesImpositionTfu.setNombreUlog(donneesImpositionTfuResponse.getNombreUlog());
|
||||||
|
donneesImpositionTfu.setNomProp(donneesImpositionTfuResponse.getNomProp());
|
||||||
|
donneesImpositionTfu.setNomSc(donneesImpositionTfuResponse.getNomSc());
|
||||||
|
donneesImpositionTfu.setNpi(donneesImpositionTfuResponse.getNpi());
|
||||||
|
donneesImpositionTfu.setNumBatiment(donneesImpositionTfuResponse.getNumBatiment()==null?"":donneesImpositionTfuResponse.getNumBatiment());
|
||||||
|
donneesImpositionTfu.setNumUniteLogement(donneesImpositionTfuResponse.getNumUniteLogement()==null?"":donneesImpositionTfuResponse.getNumUniteLogement());
|
||||||
|
donneesImpositionTfu.setPrenomProp(donneesImpositionTfuResponse.getPrenomProp());
|
||||||
|
donneesImpositionTfu.setPrenomSc(donneesImpositionTfuResponse.getPrenomSc());
|
||||||
|
donneesImpositionTfu.setRaisonSociale(donneesImpositionTfuResponse.getRaisonSociale());
|
||||||
|
donneesImpositionTfu.setSecteurId(donneesImpositionTfuResponse.getSecteurId());
|
||||||
|
donneesImpositionTfu.setStandingBat(donneesImpositionTfuResponse.getStandingBat());
|
||||||
|
donneesImpositionTfu.setStructureId(donneesImpositionTfuResponse.getStructureId());
|
||||||
|
donneesImpositionTfu.setSuperficieAuSolBat(donneesImpositionTfuResponse.getSuperficieAuSolBat());
|
||||||
|
donneesImpositionTfu.setSuperficieAuSolUlog(donneesImpositionTfuResponse.getSuperficieAuSolUlog());
|
||||||
|
donneesImpositionTfu.setTelProp(donneesImpositionTfuResponse.getTelProp());
|
||||||
|
donneesImpositionTfu.setTelSc(donneesImpositionTfuResponse.getTelSc());
|
||||||
|
donneesImpositionTfu.setTfuMetreCarre(donneesImpositionTfuResponse.getTfuMetreCarre());
|
||||||
|
donneesImpositionTfu.setTitreFoncier(donneesImpositionTfuResponse.getTitreFoncier());
|
||||||
|
donneesImpositionTfu.setValeurLocativeAdm(donneesImpositionTfuResponse.getValeurLocativeAdm());
|
||||||
|
donneesImpositionTfu.setBatimentExhonereOuiNon(donneesImpositionTfuResponse.getBatimentExhonereOuiNon());
|
||||||
|
donneesImpositionTfu.setUniteLogementExhonereOuiNon(donneesImpositionTfuResponse.getUniteLogementExhonereOuiNon());
|
||||||
|
try {
|
||||||
|
Optional<BaremRfuNonBati> baremRfuNonBatiOptional=baremRfuNonBatiRepository.findAllByCommune_IdAndZoneRfu_Id(impositionsTfu.getCommune().getId(),donneesImpositionTfu.getZoneRfuId());
|
||||||
|
if(baremRfuNonBatiOptional.isPresent()){
|
||||||
|
donneesImpositionTfu.setValeurAdministrativeParcelleNonBati(baremRfuNonBatiOptional.get().getValeurAdministrative());
|
||||||
|
donneesImpositionTfu.setTauxParcelleNonBati(baremRfuNonBatiOptional.get().getTaux());
|
||||||
|
}
|
||||||
|
|
||||||
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.TFU_FNB_GENERE);
|
|
||||||
|
|
||||||
impositionsTfu.setNombreAvisFnb(nb);
|
|
||||||
|
|
||||||
|
donneesImpositionTfuRepository.save(donneesImpositionTfu);
|
||||||
|
n++;
|
||||||
|
}catch (DataIntegrityViolationException e) {
|
||||||
|
if (e.getCause() instanceof org.hibernate.exception.ConstraintViolationException constraintEx &&
|
||||||
|
constraintEx.getSQLException().getSQLState().equals("23505")) {
|
||||||
|
System.out.println("Doublon détecté (clé unique) !");
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
impositionsTfuRepository.save(impositionsTfu);
|
impositionsTfuRepository.save(impositionsTfu);
|
||||||
|
return n;
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
public List<DonneesImpositionTfu> getDonneesFiscalesByImposition(Long impositionsId) {
|
||||||
public ImpositionsTfuPaylaodWeb genererDonneesFiscalesParcelleBatie(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb, Long userId) {
|
return donneesImpositionTfuRepository.findAllByImpositionsTfu_Id(impositionsId);
|
||||||
|
|
||||||
Integer nbb= donneesImpositionTfuRepository.genererDonneesTfuBatie(impositionsTfuPaylaodWeb.getId(),userId);
|
|
||||||
|
|
||||||
Integer nbulo= donneesImpositionTfuRepository.genererDonneesTfuBatieUniteLogement(impositionsTfuPaylaodWeb.getId(),userId);
|
|
||||||
|
|
||||||
|
|
||||||
ImpositionsTfu impositionsTfu = entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.GENERE);
|
|
||||||
|
|
||||||
impositionsTfu.setNombreAvis(nbb+nbulo+ (impositionsTfu.getNombreAvisFnb()==null?0:impositionsTfu.getNombreAvisFnb()));
|
|
||||||
impositionsTfu.setNombreAvisBatiment(nbb);
|
|
||||||
impositionsTfu.setNombreAvisUniteLog(nbulo);
|
|
||||||
|
|
||||||
impositionsTfuRepository.save(impositionsTfu);
|
|
||||||
|
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImposition(Long impositionsId) {
|
|
||||||
return donneesImpositionTfuRepository.findAllByImpositionTfuId(impositionsId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -144,24 +187,4 @@ public class DonneesImpositionTfuServiceImpl implements DonneesImpositionTfuServ
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdPageable(Long impositionsTfuId, Pageable pageable) {
|
|
||||||
return donneesImpositionTfuRepository.findAllByImpositionTfuIdPageable(impositionsTfuId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdNonBatiePageable(Long impositionsTfuId, Pageable pageable) {
|
|
||||||
return donneesImpositionTfuRepository.findAllByImpositionTfuIdNonBatiePageable(impositionsTfuId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieBatimentPageable(Long impositionsTfuId, Pageable pageable) {
|
|
||||||
return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieBatimentPageable(impositionsTfuId,pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Page<DonneesImpositionPaylaodWeb> getDonneesFiscalesByImpositionTfuIdBatieUniteLogPageable(Long impositionsTfuId, Pageable pageable) {
|
|
||||||
return donneesImpositionTfuRepository.findAllByImpositionTfuIdBatieUniteLogPageable(impositionsTfuId,pageable);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,154 +1,81 @@
|
|||||||
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.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.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 jakarta.transaction.Transactional;
|
|
||||||
import jakarta.ws.rs.NotAcceptableException;
|
|
||||||
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.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
|
||||||
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;
|
|
||||||
private final EnqueteService enqueteService;
|
|
||||||
|
|
||||||
|
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
|
|
||||||
* @param impositionsTfuPaylaodWeb
|
|
||||||
* @return
|
|
||||||
* @throws BadRequestException
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
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.getImpositionsTfuByStructureAndExercice(impositionsTfuPaylaodWeb.getStructureId(), impositionsTfuPaylaodWeb.getExerciceId());
|
List<ImpositionsTfu> impositionsTfus=impositionsTfuRepository.getImpositionsTfuByCommuneAndExercice(impositionsTfu.getCommune().getCode(),impositionsTfu.getExercice().getAnnee());
|
||||||
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à");
|
||||||
}
|
}
|
||||||
List<StatusAvis> statusAvis= new ArrayList<>();
|
impositionsTfu.setStatusAvis(StatusAvis.CREE);
|
||||||
statusAvis.add(StatusAvis.EN_COURS);
|
impositionsTfu.setDateGeneration(LocalDate.now());
|
||||||
statusAvis.add(StatusAvis.CLOTURE);
|
return impositionsTfuRepository.save(impositionsTfu);
|
||||||
statusAvis.add(StatusAvis.GENERATION_AUTORISE);
|
|
||||||
|
|
||||||
Optional<ImpositionsTfu> optionalImpositionsTfu= impositionsTfuRepository.findDistinctByStructure_IdAndExercice_IdAndStatusAvisIn(impositionsTfuPaylaodWeb.getStructureId(),impositionsTfuPaylaodWeb.getExerciceId(),statusAvis);
|
|
||||||
|
|
||||||
if(optionalImpositionsTfu.isPresent()){
|
|
||||||
throw new BadRequestException("Une Imposition est déjà dans le workflow");
|
|
||||||
}
|
|
||||||
|
|
||||||
ImpositionsTfu impositionsTfu=entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
|
||||||
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.EN_COURS);
|
|
||||||
|
|
||||||
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
|
||||||
|
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfuPaylaodWeb rejeterImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
|
public ImpositionsTfu annulerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
|
||||||
if (impositionsTfuPaylaodWeb.getId() == null) {
|
if (impositionsTfu.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(impositionsTfuPaylaodWeb.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.");
|
||||||
}
|
}
|
||||||
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
impositionsTfu.setStatusAvis(StatusAvis.ANNULE);
|
||||||
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.CLOTURE)){
|
return impositionsTfuRepository.save(impositionsTfu);
|
||||||
throw new NotAcceptableException("L'état actuel :"+impositionsTfu.getStatusAvis()+"Ne permet pas de passer au l'état rejete");
|
|
||||||
}
|
|
||||||
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.REJETE);
|
|
||||||
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public ImpositionsTfuPaylaodWeb cloturerImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
|
|
||||||
if (impositionsTfuPaylaodWeb.getId() == null) {
|
|
||||||
throw new BadRequestException("Impossible de cloturer une imposition ayant un id null.");
|
|
||||||
}
|
|
||||||
if (!impositionsTfuRepository.existsById(impositionsTfuPaylaodWeb.getId())) {
|
|
||||||
throw new NotFoundException("Impossible de trouver l'imposition spécifiée dans notre base de données.");
|
|
||||||
}
|
|
||||||
|
|
||||||
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
|
||||||
|
|
||||||
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.EN_COURS) && !impositionsTfu.getStatusAvis().equals(StatusAvis.REJETE)){
|
|
||||||
throw new NotAcceptableException("L'état actuel :"+impositionsTfu.getStatusAvis()+"Ne permet pas de passer au l'état rejete");
|
|
||||||
}
|
|
||||||
|
|
||||||
impositionsTfu.setDateCloture(LocalDate.now());
|
|
||||||
enqueteService.cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(impositionsTfu.getStructure().getId(),impositionsTfu.getExercice().getId());
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.CLOTURE);
|
|
||||||
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfuPaylaodWeb autoriserGenerationImpositionsTfu(ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws BadRequestException {
|
public ImpositionsTfu validerImpositionsTfu(ImpositionsTfu impositionsTfu) throws BadRequestException {
|
||||||
if (impositionsTfuPaylaodWeb.getId() == null) {
|
if (impositionsTfu.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(impositionsTfuPaylaodWeb.getId())) {
|
if (!impositionsTfuRepository.existsById(impositionsTfu.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver l'imposition 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.setStatusAvis(StatusAvis.VALIDE);
|
||||||
ImpositionsTfu impositionsTfu= entityFromPayLoadService.getImpositionsTfuFromPayLoadWeb(impositionsTfuPaylaodWeb);
|
return impositionsTfuRepository.save(impositionsTfu);
|
||||||
|
|
||||||
if(!impositionsTfu.getStatusAvis().equals(StatusAvis.CLOTURE)){
|
|
||||||
throw new NotFoundException("L'état actuel : "+impositionsTfu.getStatusAvis()+ " ne permet pas de passer à l'état Autorisé");
|
|
||||||
}
|
|
||||||
impositionsTfu.setDateGeneration(LocalDate.now());
|
|
||||||
impositionsTfu.setStatusAvis(StatusAvis.GENERATION_AUTORISE);
|
|
||||||
impositionsTfu =impositionsTfuRepository.save(impositionsTfu);
|
|
||||||
return impositionsTfuRepository.findByIdToDto(impositionsTfu.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImpositionsTfuPaylaodWeb updateImpositionsTfu(Long id, ImpositionsTfuPaylaodWeb impositionsTfuPaylaodWeb) throws NotFoundException {
|
public ImpositionsTfu updateImpositionsTfu(Long id, ImpositionsTfu impositionsTfu) 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 null; // impositionsTfuRepository.save(impositionsTfu);
|
return impositionsTfuRepository.save(impositionsTfu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteImpositionsTfu(Long id) throws NotFoundException {
|
public void deleteImpositionsTfu(Long id) throws NotFoundException {
|
||||||
Optional<ImpositionsTfu> impositionsTfuOptional = impositionsTfuRepository.findById(id);
|
Optional<ImpositionsTfu> impositionsTfuOptional = impositionsTfuRepository.findById(id);
|
||||||
if (impositionsTfuOptional.isPresent()) {
|
if (impositionsTfuOptional.isPresent()) {
|
||||||
if(!impositionsTfuOptional.get().getStatusAvis().equals(StatusAvis.EN_COURS)){
|
|
||||||
throw new NotFoundException("L'état actuel : "+impositionsTfuOptional.get().getStatusAvis()+ " ne permet pas de supprimer");
|
|
||||||
}
|
|
||||||
impositionsTfuRepository.deleteById(impositionsTfuOptional.get().getId());
|
impositionsTfuRepository.deleteById(impositionsTfuOptional.get().getId());
|
||||||
} else {
|
} else {
|
||||||
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.");
|
||||||
@@ -167,22 +94,11 @@ public class ImpositionsTfuServiceImpl implements ImpositionsTfuService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<ImpositionsTfuPaylaodWeb> getImpositionsTfuById(Long id) {
|
public Optional<ImpositionsTfu> getImpositionsTfuById(Long id) {
|
||||||
if (impositionsTfuRepository.existsById(id)) {
|
if (impositionsTfuRepository.existsById(id)) {
|
||||||
return impositionsTfuRepository.findByIdToDto(id);
|
return impositionsTfuRepository.findById(id);
|
||||||
} else {
|
} else {
|
||||||
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) {
|
|
||||||
System.out.println(userId);
|
|
||||||
List<Structure> structures = structureService.getListStructureUserId(userId);
|
|
||||||
List<Long> structureIds = structures.stream()
|
|
||||||
.map(Structure::getId)
|
|
||||||
.toList();
|
|
||||||
System.out.println(structureIds.get(0));
|
|
||||||
return impositionsTfuRepository.findByStructureIdsToDto(structureIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,9 +86,4 @@ public class UniteLogementServiceImpl implements UniteLogementService {
|
|||||||
public List<UniteLogementPaylaodWeb> getUniteLogementListByBatiment(Long batimentId) {
|
public List<UniteLogementPaylaodWeb> getUniteLogementListByBatiment(Long batimentId) {
|
||||||
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByBatimentToDto(batimentId);
|
return uniteLogementRepository.findUnitesLogementAvecOccupantCourantByBatimentToDto(batimentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<UniteLogementPaylaodWeb> getUniteLogementListByParcelle(Long parcelleId) {
|
|
||||||
return uniteLogementRepository.findAllUnitesLogementAvecOccupantCourantByParcelleToDto(parcelleId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,92 +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.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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,42 +4,38 @@ import io.gmss.fiscad.entities.rfu.parametre.BaremRfuNonBati;
|
|||||||
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.BaremRfuNonBatiService;
|
import io.gmss.fiscad.interfaces.rfu.parametre.BaremRfuNonBatiService;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.BaremRfuNonBatiPayloadWeb;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
|
import io.gmss.fiscad.persistence.repositories.rfu.parametre.BaremRfuNonBatiRepository;
|
||||||
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;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@AllArgsConstructor
|
|
||||||
@Service
|
@Service
|
||||||
public class BaremRfuNonBatiServiceImpl implements BaremRfuNonBatiService {
|
public class BaremRfuNonBatiServiceImpl implements BaremRfuNonBatiService {
|
||||||
private final BaremRfuNonBatiRepository baremRfuNonBatiRepository;
|
private final BaremRfuNonBatiRepository baremRfuNonBatiRepository;
|
||||||
private final EntityFromPayLoadService entityFromPayLoadService;
|
|
||||||
|
public BaremRfuNonBatiServiceImpl(BaremRfuNonBatiRepository baremRfuNonBatiRepository) {
|
||||||
|
this.baremRfuNonBatiRepository = baremRfuNonBatiRepository;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaremRfuNonBatiPayloadWeb createBaremRfuNonBati(BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) throws BadRequestException {
|
public BaremRfuNonBati createBaremRfuNonBati(BaremRfuNonBati baremRfuNonBati) throws BadRequestException {
|
||||||
if (baremRfuNonBatiPayloadWeb.getId() != null) {
|
if (baremRfuNonBati.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.");
|
||||||
}
|
}
|
||||||
BaremRfuNonBati baremRfuNonBati= entityFromPayLoadService.getBaremRfuNonBatiFromPayLoadWeb(baremRfuNonBatiPayloadWeb);
|
return baremRfuNonBatiRepository.save(baremRfuNonBati);
|
||||||
baremRfuNonBati=baremRfuNonBatiRepository.save(baremRfuNonBati);
|
|
||||||
return baremRfuNonBatiRepository.findByIdToDto(baremRfuNonBati.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public BaremRfuNonBatiPayloadWeb updateBaremRfuNonBati(Long id, BaremRfuNonBatiPayloadWeb baremRfuNonBatiPayloadWeb) throws NotFoundException {
|
public BaremRfuNonBati updateBaremRfuNonBati(Long id, BaremRfuNonBati baremRfuNonBati) throws NotFoundException {
|
||||||
if (baremRfuNonBatiPayloadWeb.getId() == null) {
|
if (baremRfuNonBati.getId() == null) {
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle baremRfuNonBati ayant un id null.");
|
throw new BadRequestException("Impossible de mettre à jour une nouvelle baremRfuNonBati ayant un id null.");
|
||||||
}
|
}
|
||||||
if (!baremRfuNonBatiRepository.existsById(baremRfuNonBatiPayloadWeb.getId())) {
|
if (!baremRfuNonBatiRepository.existsById(baremRfuNonBati.getId())) {
|
||||||
throw new NotFoundException("Impossible de trouver la baremRfuNonBati spécifiée dans notre base de données.");
|
throw new NotFoundException("Impossible de trouver la baremRfuNonBati spécifiée dans notre base de données.");
|
||||||
}
|
}
|
||||||
BaremRfuNonBati baremRfuNonBati= entityFromPayLoadService.getBaremRfuNonBatiFromPayLoadWeb(baremRfuNonBatiPayloadWeb);
|
return baremRfuNonBatiRepository.save(baremRfuNonBati);
|
||||||
baremRfuNonBati=baremRfuNonBatiRepository.save(baremRfuNonBati);
|
|
||||||
return baremRfuNonBatiRepository.findByIdToDto(baremRfuNonBati.getId()).orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -52,27 +48,20 @@ public class BaremRfuNonBatiServiceImpl implements BaremRfuNonBatiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Page<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiList(Pageable pageable) {
|
public Page<BaremRfuNonBati> getBaremRfuNonBatiList(Pageable pageable) {
|
||||||
return baremRfuNonBatiRepository.findAllPayloadToDtoPaged(pageable);
|
return baremRfuNonBatiRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiList() {
|
public List<BaremRfuNonBati> getBaremRfuNonBatiList() {
|
||||||
return baremRfuNonBatiRepository.findAllPayloadToDto();
|
return baremRfuNonBatiRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiById(Long id) {
|
public Optional<BaremRfuNonBati> getBaremRfuNonBatiById(Long id) {
|
||||||
return baremRfuNonBatiRepository.findByIdToDto(id);
|
return baremRfuNonBatiRepository.findById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<BaremRfuNonBatiPayloadWeb> getBaremRfuNonBatiByCommuneAndZoneId(Long communeId,Long zoneId) {
|
|
||||||
return baremRfuNonBatiRepository.findByCommuneAndZoneToDto(communeId,zoneId);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
package io.gmss.fiscad.implementations.rfu.parametre;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.rfu.parametre.Usage;
|
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
|
||||||
import io.gmss.fiscad.interfaces.rfu.parametre.UsageService;
|
|
||||||
import io.gmss.fiscad.persistence.repositories.rfu.parametre.UsageRepository;
|
|
||||||
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 UsageServiceImpl implements UsageService {
|
|
||||||
private final UsageRepository usageRepository;
|
|
||||||
|
|
||||||
public UsageServiceImpl(UsageRepository usageRepository) {
|
|
||||||
this.usageRepository = usageRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Usage createUsage(Usage usage) throws BadRequestException {
|
|
||||||
if (usage.getId() != null) {
|
|
||||||
throw new BadRequestException("Impossible de créer une nouvelle campgne ayant un id non null.");
|
|
||||||
}
|
|
||||||
return usageRepository.save(usage);
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Usage updateUsage(Long id, Usage usage) throws NotFoundException {
|
|
||||||
if (usage.getId() == null) {
|
|
||||||
throw new BadRequestException("Impossible de mettre à jour une nouvelle usage ayant un id null.");
|
|
||||||
}
|
|
||||||
if (!usageRepository.existsById(usage.getId())) {
|
|
||||||
throw new NotFoundException("Impossible de trouver la usage spécifiée dans notre base de données.");
|
|
||||||
}
|
|
||||||
return usageRepository.save(usage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteUsage(Long id) throws NotFoundException {
|
|
||||||
Optional<Usage> usageOptional = usageRepository.findById(id);
|
|
||||||
if (usageOptional.isPresent()) {
|
|
||||||
usageRepository.deleteById(usageOptional.get().getId());
|
|
||||||
} else {
|
|
||||||
throw new NotFoundException("Impossible de trouver la usage spécifiée dans notre base de données.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public Page<Usage> getUsageList(Pageable pageable) {
|
|
||||||
return usageRepository.findAll(pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<Usage> getUsageList() {
|
|
||||||
return usageRepository.findAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<Usage> getUsageById(Long id) {
|
|
||||||
return usageRepository.findById(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -32,5 +32,4 @@ 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) ;
|
|
||||||
}
|
}
|
||||||
@@ -19,24 +19,23 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface EnqueteService {
|
public interface EnqueteService {
|
||||||
|
|
||||||
EnquetePayLoadWeb createEnquete(EnquetePayLoadWeb enquetePayLoad) throws BadRequestException;
|
Enquete createEnquete(EnquetePayLoadWeb enquetePayLoad) throws BadRequestException;
|
||||||
|
|
||||||
EnquetePayLoadWeb updateEnquete(Long id,EnquetePayLoadWeb enquete) throws NotFoundException;
|
Enquete updateEnquete(Long id,EnquetePayLoadWeb enquete) throws NotFoundException;
|
||||||
|
|
||||||
void deleteEnquete(Long id) throws NotFoundException;
|
void deleteEnquete(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<EnquetePayLoadWeb> getEnqueteList(Pageable pageable);
|
Page<Enquete> getEnqueteList(Pageable pageable);
|
||||||
|
|
||||||
List<EnquetePayLoadWeb> getEnqueteList();
|
List<Enquete> getEnqueteList();
|
||||||
|
|
||||||
List<EnquetePayLoadWeb> getEnqueteListByParcelle(Long parcelleId);
|
List<Enquete> getEnqueteListByParcelle(Long parcelleId);
|
||||||
Page<EnquetePayLoadWeb> getEnqueteListByParcellePageable(Long parcelleId,Pageable pageable);
|
|
||||||
|
|
||||||
List<EnqueteResponse> getEnqueteCommuneArrondBloc();
|
List<EnqueteResponse> getEnqueteCommuneArrondBloc();
|
||||||
|
|
||||||
List<EnqueteFiltreResponse> getEnqueteCommuneArrondBlocFiltre(FiltreEnquetePayLoad filtreEnquetePayLoad);
|
List<EnqueteFiltreResponse> getEnqueteCommuneArrondBlocFiltre(FiltreEnquetePayLoad filtreEnquetePayLoad);
|
||||||
|
|
||||||
Optional<EnquetePayLoadWeb> getEnqueteById(Long id);
|
Optional<Enquete> getEnqueteById(Long id);
|
||||||
|
|
||||||
Enquete validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
|
Enquete validerEnquete(EnqueteTraitementPayLoad enqueteTraitementPayLoad);
|
||||||
|
|
||||||
@@ -58,6 +57,5 @@ public interface EnqueteService {
|
|||||||
|
|
||||||
public List<EnqueteNonSyncResponse> getEnqueteValideNonSynch(Long terminalId);
|
public List<EnqueteNonSyncResponse> getEnqueteValideNonSynch(Long terminalId);
|
||||||
|
|
||||||
int cloturerEnqueteParcelleBatimentUniteLogementByStructureIdAndExerciceId(Long strucutreId,Long exerciceId);
|
|
||||||
int cloturerEnqueteParcelleBatimentUniteLogementByUserIdAndExerciceId(Long userId,Long exerciceId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import io.gmss.fiscad.entities.infocad.metier.ParcelleGeom;
|
|||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
||||||
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.ParcelleGeomPaylaodWeb;
|
|
||||||
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.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -16,15 +15,12 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface ParcelleGeomService {
|
public interface ParcelleGeomService {
|
||||||
int createParcelleFromGeoJsonFile(MultipartFile file,String reference,String description) throws BadRequestException;
|
int createParcelleFromGeoJsonFile(MultipartFile file,String reference,String description) throws BadRequestException;
|
||||||
int createParcelleGeomFromGeoJsonApi() throws BadRequestException;
|
|
||||||
ParcelleGeom createOnParcelleFromGeoJson(JsonNode jsonNode, Upload upload) throws BadRequestException;
|
ParcelleGeom createOnParcelleFromGeoJson(JsonNode jsonNode, Upload upload) throws BadRequestException;
|
||||||
ParcelleGeom updateParcelleGeom(MultipartFile file) throws NotFoundException;
|
ParcelleGeom updateParcelleGeom(MultipartFile file) throws NotFoundException;
|
||||||
void deleteParcelle(Long id) throws NotFoundException;
|
void deleteParcelle(Long id) throws NotFoundException;
|
||||||
Page<ParcelleGeom> getParcelleGeomList(Pageable pageable);
|
Page<ParcelleGeom> getParcelleGeomList(Pageable pageable);
|
||||||
List<ParcelleGeom> getParcelleGeomList();
|
List<ParcelleGeom> getParcelleGeomList();
|
||||||
List<ParcelleGeom> getParcelleGeomListUnQuatier(String codeQuartier);
|
List<ParcelleGeom> getParcelleGeomListUnQuatier(String codeQuartier);
|
||||||
List<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierId(Long quartierId);
|
|
||||||
Page<ParcelleGeomPaylaodWeb> getParcelleGeomListByQuatierIdPaged(Long quartierId,Pageable pageable);
|
|
||||||
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement);
|
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement);
|
||||||
|
|
||||||
Optional<ParcelleGeom> getParcelleGeomById(Long id);
|
Optional<ParcelleGeom> getParcelleGeomById(Long id);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.infocad.metier;
|
|||||||
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
import io.gmss.fiscad.entities.infocad.metier.Parcelle;
|
||||||
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.FiltreParcelle;
|
|
||||||
import io.gmss.fiscad.paylaods.request.FiltreParcellePayLoad;
|
import io.gmss.fiscad.paylaods.request.FiltreParcellePayLoad;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.ParcellePayLoadWeb;
|
||||||
import io.gmss.fiscad.paylaods.response.dataTableResponse.ParcelleDataTableResponse;
|
import io.gmss.fiscad.paylaods.response.dataTableResponse.ParcelleDataTableResponse;
|
||||||
@@ -17,9 +16,9 @@ import java.util.Optional;
|
|||||||
public interface ParcelleService {
|
public interface ParcelleService {
|
||||||
|
|
||||||
|
|
||||||
ParcellePayLoadWeb createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException;
|
Parcelle createParcelle(ParcellePayLoadWeb parcellePayLoadWeb) throws BadRequestException;
|
||||||
|
|
||||||
ParcellePayLoadWeb updateParcelle(Long id,ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException;
|
Parcelle updateParcelle(Long id,ParcellePayLoadWeb parcellePayLoadWeb) throws NotFoundException;
|
||||||
|
|
||||||
void deleteParcelle(Long id) throws NotFoundException;
|
void deleteParcelle(Long id) throws NotFoundException;
|
||||||
Optional<Parcelle> getParcelleById(Long id);
|
Optional<Parcelle> getParcelleById(Long id);
|
||||||
@@ -34,6 +33,9 @@ public interface ParcelleService {
|
|||||||
List<ParcellePayLoadWeb> getParcelleListByRueToDto(Long userId,Long rueId);
|
List<ParcellePayLoadWeb> getParcelleListByRueToDto(Long userId,Long rueId);
|
||||||
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);
|
|
||||||
Integer majParcelleBatieNonbatie();
|
|
||||||
|
|
||||||
|
Page<ParcelleDataTableResponse> getParcelleDataTableListByUserId(Long userId, Pageable pageable);
|
||||||
|
Page<ParcelleDataTableResponse> getParcelleDataTableListByMultiFiltre(Long userId, FiltreParcellePayLoad filtreParcellePayLoad, Pageable pageable);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import io.gmss.fiscad.entities.infocad.parametre.Personne;
|
|||||||
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.dto.PersonneCompletDTO;
|
import io.gmss.fiscad.paylaods.dto.PersonneCompletDTO;
|
||||||
import io.gmss.fiscad.paylaods.request.RecherchePersonneResquestBody;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.PersonnePayLoadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.PersonnePayLoadWeb;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -14,17 +13,16 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface PersonneService {
|
public interface PersonneService {
|
||||||
|
|
||||||
PersonnePayLoadWeb createPersonne(PersonnePayLoadWeb personnePayLoadWeb) throws BadRequestException;
|
Personne createPersonne(PersonnePayLoadWeb personnePayLoadWeb) throws BadRequestException;
|
||||||
|
|
||||||
PersonnePayLoadWeb updatePersonne(Long id, PersonnePayLoadWeb personnePayLoadWeb) throws NotFoundException;
|
Personne updatePersonne(Long id, PersonnePayLoadWeb personnePayLoadWeb) throws NotFoundException;
|
||||||
|
|
||||||
void deletePersonne(Long id) throws NotFoundException;
|
void deletePersonne(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<PersonnePayLoadWeb> getPersonneList(Pageable pageable);
|
Page<Personne> getPersonneList(Pageable pageable);
|
||||||
|
|
||||||
List<PersonnePayLoadWeb> getPersonneList();
|
List<Personne> getPersonneList();
|
||||||
|
|
||||||
Optional<PersonnePayLoadWeb> getPersonneById(Long id);
|
Optional<Personne> getPersonneById(Long id);
|
||||||
PersonneCompletDTO getPersonneComplete(Long id);
|
PersonneCompletDTO getPersonneComplete(Long id);
|
||||||
List<PersonnePayLoadWeb> recherchePersonne(RecherchePersonneResquestBody recherchePersonneResquestBody);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.infocad.metier;
|
|||||||
import io.gmss.fiscad.entities.infocad.metier.Piece;
|
import io.gmss.fiscad.entities.infocad.metier.Piece;
|
||||||
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.PiecePayLoadWeb;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -12,21 +11,15 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface PieceService {
|
public interface PieceService {
|
||||||
|
|
||||||
PiecePayLoadWeb createPiece(PiecePayLoadWeb piecePayLoadWeb) throws BadRequestException;
|
Piece createPiece(Piece piece) throws BadRequestException;
|
||||||
|
|
||||||
PiecePayLoadWeb updatePiece(Long id, PiecePayLoadWeb piecePayLoadWeb) throws NotFoundException;
|
Piece updatePiece(Long id, Piece piece) throws NotFoundException;
|
||||||
|
|
||||||
void deletePiece(Long id) throws NotFoundException;
|
void deletePiece(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<PiecePayLoadWeb> getPieceListToDtoPageable(Pageable pageable);
|
Page<Piece> getPieceList(Pageable pageable);
|
||||||
|
|
||||||
List<PiecePayLoadWeb> getPieceListToDto();
|
List<Piece> getPieceList();
|
||||||
|
|
||||||
Optional<PiecePayLoadWeb> getPieceByToDto(Long id);
|
Optional<Piece> getPieceById(Long id);
|
||||||
List<PiecePayLoadWeb> getAllPieceByEnqueteToDto(Long id);
|
|
||||||
Page<PiecePayLoadWeb> getAllPieceByEnqueteToDtoPageable(Long id,Pageable pageable);
|
|
||||||
|
|
||||||
List<PiecePayLoadWeb> getAllPieceByEnqueteBatimentToDto(Long id);
|
|
||||||
|
|
||||||
List<PiecePayLoadWeb> getAllPieceByEnqueteUniteLogementToDto(Long id);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package io.gmss.fiscad.interfaces.infocad.metier;
|
|
||||||
|
|
||||||
import io.gmss.fiscad.entities.infocad.metier.Upload;
|
|
||||||
import io.gmss.fiscad.exceptions.BadRequestException;
|
|
||||||
import io.gmss.fiscad.exceptions.NotFoundException;
|
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.UploadPayLoadWeb;
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public interface UploadService {
|
|
||||||
|
|
||||||
UploadPayLoadWeb createUpload(UploadPayLoadWeb piecePayLoadWeb) throws BadRequestException;
|
|
||||||
Upload createUpload(MultipartFile file, @RequestParam Long pieceId) throws BadRequestException;
|
|
||||||
|
|
||||||
UploadPayLoadWeb updateUpload(Long id, UploadPayLoadWeb piecePayLoadWeb) throws NotFoundException;
|
|
||||||
|
|
||||||
void deleteUpload(Long id) throws NotFoundException;
|
|
||||||
|
|
||||||
Page<UploadPayLoadWeb> getUploadListToDtoPageable(Pageable pageable);
|
|
||||||
|
|
||||||
List<UploadPayLoadWeb> getUploadListToDto();
|
|
||||||
|
|
||||||
Optional<UploadPayLoadWeb> getUploadByToDto(Long id);
|
|
||||||
List<UploadPayLoadWeb> getAllUploadByPieceToDto(Long id);
|
|
||||||
Page<UploadPayLoadWeb> getAllUploadByPieceDtoPageable(Long id,Pageable pageable);
|
|
||||||
|
|
||||||
List<Upload> getAllUploadByPiece(Long id);
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
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;
|
||||||
@@ -10,8 +8,6 @@ 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;
|
||||||
|
|
||||||
@@ -35,6 +31,4 @@ public interface StructureService {
|
|||||||
//List<StructureResponse> getStructuresByArrondissement(Long arrondissementID);
|
//List<StructureResponse> getStructuresByArrondissement(Long arrondissementID);
|
||||||
|
|
||||||
|
|
||||||
public List<Structure> getListStructureUserId(Long userId) ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.metier;
|
|||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
||||||
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.CaracteristiqueBatimentPayloadWeb;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -12,19 +11,15 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface CaracteristiqueBatimentService {
|
public interface CaracteristiqueBatimentService {
|
||||||
|
|
||||||
CaracteristiqueBatimentPayloadWeb createCaracteristiqueBatiment(CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) throws BadRequestException;
|
CaracteristiqueBatiment createCaracteristiqueBatiment(CaracteristiqueBatiment caracteristiqueBatiment) throws BadRequestException;
|
||||||
|
|
||||||
CaracteristiqueBatimentPayloadWeb updateCaracteristiqueBatiment(Long id, CaracteristiqueBatimentPayloadWeb caracteristiqueBatimentPayloadWeb) throws NotFoundException;
|
CaracteristiqueBatiment updateCaracteristiqueBatiment(Long id, CaracteristiqueBatiment caracteristiqueBatiment) throws NotFoundException;
|
||||||
|
|
||||||
void deleteCaracteristiqueBatiment(Long id) throws NotFoundException;
|
void deleteCaracteristiqueBatiment(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentList(Pageable pageable);
|
Page<CaracteristiqueBatiment> getCaracteristiqueBatimentList(Pageable pageable);
|
||||||
|
|
||||||
List<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentList();
|
List<CaracteristiqueBatiment> getCaracteristiqueBatimentList();
|
||||||
|
|
||||||
Optional<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentToDto(Long id);
|
Optional<CaracteristiqueBatiment> getCaracteristiqueBatimentById(Long id);
|
||||||
|
|
||||||
Page<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentListByEnqueteBatimentPageable(Long enqueteBatimentId, Pageable pageable);
|
|
||||||
|
|
||||||
List<CaracteristiqueBatimentPayloadWeb> getCaracteristiqueBatimentListByEnqueteBatiment(Long enqueteBatimentId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.metier;
|
|||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueParcelle;
|
||||||
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.CaracteristiqueParcellePayloadWeb;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -12,9 +11,9 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface CaracteristiqueParcelleService {
|
public interface CaracteristiqueParcelleService {
|
||||||
|
|
||||||
CaracteristiqueParcellePayloadWeb createCaracteristiqueParcelle(CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) throws BadRequestException;
|
CaracteristiqueParcelle createCaracteristiqueParcelle(CaracteristiqueParcelle caracteristiqueParcelle) throws BadRequestException;
|
||||||
|
|
||||||
CaracteristiqueParcellePayloadWeb updateCaracteristiqueParcelle(Long id, CaracteristiqueParcellePayloadWeb caracteristiqueParcellePayloadWeb) throws NotFoundException;
|
CaracteristiqueParcelle updateCaracteristiqueParcelle(Long id, CaracteristiqueParcelle caracteristiqueParcelle) throws NotFoundException;
|
||||||
|
|
||||||
void deleteCaracteristiqueParcelle(Long id) throws NotFoundException;
|
void deleteCaracteristiqueParcelle(Long id) throws NotFoundException;
|
||||||
|
|
||||||
@@ -22,8 +21,5 @@ public interface CaracteristiqueParcelleService {
|
|||||||
|
|
||||||
List<CaracteristiqueParcelle> getCaracteristiqueParcelleList();
|
List<CaracteristiqueParcelle> getCaracteristiqueParcelleList();
|
||||||
|
|
||||||
Optional<CaracteristiqueParcellePayloadWeb> getCaracteristiqueParcelleById(Long id);
|
Optional<CaracteristiqueParcelle> getCaracteristiqueParcelleById(Long id);
|
||||||
Page<CaracteristiqueParcellePayloadWeb> getCaracteristiqueParcelleByEnqueteListPageable(Long enqueteId, Pageable pageable);
|
|
||||||
|
|
||||||
List<CaracteristiqueParcellePayloadWeb> getCaracteristiqueParcelleByEnqueteList(Long enqueteId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.metier;
|
|||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
||||||
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.CaracteristiqueUniteLogementPayloadWeb;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -12,18 +11,15 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface CaracteristiqueUniteLogementService {
|
public interface CaracteristiqueUniteLogementService {
|
||||||
|
|
||||||
CaracteristiqueUniteLogementPayloadWeb createCaracteristiqueUniteLogement(CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) throws BadRequestException;
|
CaracteristiqueUniteLogement createCaracteristiqueUniteLogement(CaracteristiqueUniteLogement caracteristiqueUniteLogement) throws BadRequestException;
|
||||||
|
|
||||||
CaracteristiqueUniteLogementPayloadWeb updateCaracteristiqueUniteLogement(Long id, CaracteristiqueUniteLogementPayloadWeb caracteristiqueUniteLogementPayloadWeb) throws NotFoundException;
|
CaracteristiqueUniteLogement updateCaracteristiqueUniteLogement(Long id, CaracteristiqueUniteLogement caracteristiqueUniteLogement) throws NotFoundException;
|
||||||
|
|
||||||
void deleteCaracteristiqueUniteLogement(Long id) throws NotFoundException;
|
void deleteCaracteristiqueUniteLogement(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementList(Pageable pageable);
|
Page<CaracteristiqueUniteLogement> getCaracteristiqueUniteLogementList(Pageable pageable);
|
||||||
|
|
||||||
List<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementList();
|
List<CaracteristiqueUniteLogement> getCaracteristiqueUniteLogementList();
|
||||||
|
|
||||||
Optional<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementById(Long id);
|
Optional<CaracteristiqueUniteLogement> getCaracteristiqueUniteLogementById(Long id);
|
||||||
Page<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementListByEul(Long id,Pageable pageable);
|
|
||||||
|
|
||||||
List<CaracteristiqueUniteLogementPayloadWeb> getCaracteristiqueUniteLogementListbyEul(Long id);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package io.gmss.fiscad.interfaces.rfu.metier;
|
|||||||
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
import io.gmss.fiscad.entities.rfu.metier.DeclarationNc;
|
||||||
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.DeclarationNcPayloadWeb;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
@@ -12,19 +11,15 @@ import java.util.Optional;
|
|||||||
|
|
||||||
public interface DeclarationNcService {
|
public interface DeclarationNcService {
|
||||||
|
|
||||||
DeclarationNcPayloadWeb createDeclarationNc(DeclarationNcPayloadWeb declarationNcPayloadWeb) throws BadRequestException;
|
DeclarationNc createDeclarationNc(DeclarationNc declarationNc) throws BadRequestException;
|
||||||
|
|
||||||
DeclarationNcPayloadWeb updateDeclarationNc(Long id, DeclarationNcPayloadWeb declarationNcPayloadWeb) throws NotFoundException;
|
DeclarationNc updateDeclarationNc(Long id, DeclarationNc declarationNc) throws NotFoundException;
|
||||||
|
|
||||||
void deleteDeclarationNc(Long id) throws NotFoundException;
|
void deleteDeclarationNc(Long id) throws NotFoundException;
|
||||||
|
|
||||||
Page<DeclarationNcPayloadWeb> getDeclarationNcList(Pageable pageable);
|
Page<DeclarationNc> getDeclarationNcList(Pageable pageable);
|
||||||
|
|
||||||
List<DeclarationNcPayloadWeb> getDeclarationNcList();
|
List<DeclarationNc> getDeclarationNcList();
|
||||||
|
|
||||||
Optional<DeclarationNcPayloadWeb> getDeclarationNcById(Long id);
|
Optional<DeclarationNc> getDeclarationNcById(Long id);
|
||||||
|
|
||||||
Page<DeclarationNcPayloadWeb> getDeclarationNcByPersonneList(Long personneId,Pageable pageable);
|
|
||||||
|
|
||||||
List<DeclarationNcPayloadWeb> getDeclarationNcByPersonneList(Long personneId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user