Initial commit
This commit is contained in:
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
infocad.log*
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
target/*
|
||||||
|
ansible
|
||||||
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Executable file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Executable file
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2007-present the original author or authors.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import java.net.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.nio.channels.*;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
public class MavenWrapperDownloader {
|
||||||
|
|
||||||
|
private static final String WRAPPER_VERSION = "0.5.6";
|
||||||
|
/**
|
||||||
|
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||||
|
*/
|
||||||
|
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||||
|
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||||
|
* use instead of the default one.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.properties";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path where the maven-wrapper.jar will be saved to.
|
||||||
|
*/
|
||||||
|
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||||
|
".mvn/wrapper/maven-wrapper.jar";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the property which should be used to override the default download url for the wrapper.
|
||||||
|
*/
|
||||||
|
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||||
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println("- Downloader started");
|
||||||
|
File baseDirectory = new File(args[0]);
|
||||||
|
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||||
|
|
||||||
|
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||||
|
// wrapperUrl parameter.
|
||||||
|
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||||
|
String url = DEFAULT_DOWNLOAD_URL;
|
||||||
|
if(mavenWrapperPropertyFile.exists()) {
|
||||||
|
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||||
|
try {
|
||||||
|
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||||
|
Properties mavenWrapperProperties = new Properties();
|
||||||
|
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||||
|
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if(mavenWrapperPropertyFileInputStream != null) {
|
||||||
|
mavenWrapperPropertyFileInputStream.close();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// Ignore ...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading from: " + url);
|
||||||
|
|
||||||
|
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||||
|
if(!outputFile.getParentFile().exists()) {
|
||||||
|
if(!outputFile.getParentFile().mkdirs()) {
|
||||||
|
System.out.println(
|
||||||
|
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||||
|
try {
|
||||||
|
downloadFileFromURL(url, outputFile);
|
||||||
|
System.out.println("Done");
|
||||||
|
System.exit(0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
System.out.println("- Error downloading");
|
||||||
|
e.printStackTrace();
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||||
|
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||||
|
String username = System.getenv("MVNW_USERNAME");
|
||||||
|
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||||
|
Authenticator.setDefault(new Authenticator() {
|
||||||
|
@Override
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(username, password);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
URL website = new URL(urlString);
|
||||||
|
ReadableByteChannel rbc;
|
||||||
|
rbc = Channels.newChannel(website.openStream());
|
||||||
|
FileOutputStream fos = new FileOutputStream(destination);
|
||||||
|
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||||
|
fos.close();
|
||||||
|
rbc.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Executable file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Executable file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Executable file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
|
||||||
|
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||||
26
Fiscad.iml
Normal file
26
Fiscad.iml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module version="4">
|
||||||
|
<component name="AdditionalModuleElements">
|
||||||
|
<content url="file://$MODULE_DIR$" dumb="true">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
</component>
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="jpa" name="JPA">
|
||||||
|
<configuration>
|
||||||
|
<setting name="validation-enabled" value="true" />
|
||||||
|
<setting name="provider-name" value="Hibernate" />
|
||||||
|
<datasource-mapping>
|
||||||
|
<factory-entry name="entityManagerFactory" />
|
||||||
|
</datasource-mapping>
|
||||||
|
<naming-strategy-map />
|
||||||
|
</configuration>
|
||||||
|
</facet>
|
||||||
|
<facet type="Spring" name="Spring">
|
||||||
|
<configuration />
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
9
HELP.md
Executable file
9
HELP.md
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
# Getting Started
|
||||||
|
|
||||||
|
### Reference Documentation
|
||||||
|
For further reference, please consider the following sections:
|
||||||
|
|
||||||
|
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
|
||||||
|
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/)
|
||||||
|
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.4/maven-plugin/reference/html/#build-image)
|
||||||
|
|
||||||
40
Jenkinsfile
vendored
Normal file
40
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
tools {
|
||||||
|
jdk 'jenkins-jdk'
|
||||||
|
maven 'jenkins-maven'
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
git url: 'https://gitlab.com/christianakpona/infocad.git', branch: 'main'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh 'mvn clean package'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Lint') {
|
||||||
|
steps {
|
||||||
|
// Change directory to 'ansible/' before running ansible-lint
|
||||||
|
dir('ansible') {
|
||||||
|
sh '/usr/local/bin/ansible-lint playbook_jenkins.yml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy') {
|
||||||
|
steps {
|
||||||
|
// Change directory to 'ansible/' before running ansible-playbook
|
||||||
|
dir('ansible') {
|
||||||
|
sh '/usr/local/bin/ansible-playbook playbook_jenkins.yml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
jasperReport/andf.png
Normal file
BIN
jasperReport/andf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
245
jasperReport/listBlocParStructure.jrxml
Normal file
245
jasperReport/listBlocParStructure.jrxml
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Created with Jaspersoft Studio version 6.21.3.final using JasperReports Library version 6.21.3-4a3078d20785ebe464f18037d738d12fc98c13cf -->
|
||||||
|
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="listBlocParStructure" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="60393fd8-8f4e-44f7-8418-0139271081b1">
|
||||||
|
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit." value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
|
||||||
|
<parameter name="structure" class="java.lang.String"/>
|
||||||
|
<parameter name="logoDroit" class="java.lang.String"/>
|
||||||
|
<parameter name="logoGauche" class="java.lang.String"/>
|
||||||
|
<queryString>
|
||||||
|
<![CDATA[]]>
|
||||||
|
</queryString>
|
||||||
|
<field name="code" class="java.lang.String"/>
|
||||||
|
<field name="nom" class="java.lang.String"/>
|
||||||
|
<field name="arrondissement" class="java.lang.String"/>
|
||||||
|
<field name="commune" class="java.lang.String"/>
|
||||||
|
<field name="departement" class="java.lang.String"/>
|
||||||
|
<background>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</background>
|
||||||
|
<title>
|
||||||
|
<band height="134" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="179" y="75" width="421" height="30" uuid="10a08362-9a39-4235-a0d1-33a733f0861e"/>
|
||||||
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
|
<font size="16" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[LISTE DES BLOCS]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="0" y="112" width="90" height="20" uuid="4368e598-76c3-4ad7-867e-c3c9efe5ebd8"/>
|
||||||
|
<textElement textAlignment="Left" verticalAlignment="Middle">
|
||||||
|
<font size="14" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Structure :]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField >
|
||||||
|
<reportElement x="90" y="112" width="590" height="20" uuid="890f9a0d-98c7-4acd-becc-ea41d147c44d"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="12"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$P{structure}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<image>
|
||||||
|
<reportElement x="0" y="0" width="200" height="70" uuid="e194874d-8732-48bc-b829-5eee66cd557d"/>
|
||||||
|
<imageExpression><![CDATA[$P{logoGauche}]]></imageExpression>
|
||||||
|
</image>
|
||||||
|
<image>
|
||||||
|
<reportElement x="455" y="0" width="100" height="70" uuid="f2e94782-7bfb-4a44-b7d7-8a1815583080"/>
|
||||||
|
<imageExpression><![CDATA[$P{logoDroit}]]></imageExpression>
|
||||||
|
</image>
|
||||||
|
</band>
|
||||||
|
</title>
|
||||||
|
<pageHeader>
|
||||||
|
<band height="19" splitType="Stretch"/>
|
||||||
|
</pageHeader>
|
||||||
|
<columnHeader>
|
||||||
|
<band height="20" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="0" y="0" width="110" height="20" backcolor="#E6E3E3" uuid="331a2555-93cf-45c8-b0b5-7b2852a4d2f3">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6ac9f7a7-6945-49f9-bb3f-304b676fe0cc"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Code]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="110" y="0" width="220" height="20" backcolor="#E6E3E3" uuid="c4d92ed2-0221-46f2-927d-b475c27e868f">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Nom]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="330" y="0" width="185" height="20" backcolor="#E6E3E3" uuid="2afc91ad-3b7c-4095-a7fc-971d233e3a80">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Arrondissement]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="515" y="0" width="145" height="20" backcolor="#E6E3E3" uuid="86774042-75a8-480b-8cee-b051aaf448f3">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Commune]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="660" y="0" width="140" height="20" backcolor="#E6E3E3" uuid="c083896b-34f1-4034-8422-171bac20fa8b">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Département]]></text>
|
||||||
|
</staticText>
|
||||||
|
</band>
|
||||||
|
</columnHeader>
|
||||||
|
<detail>
|
||||||
|
<band height="20" splitType="Stretch">
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="0" y="0" width="110" height="20" uuid="1d95f143-1f8d-4f69-a9fe-e35b552a3e90">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6ac9f7a7-6945-49f9-bb3f-304b676fe0cc"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{code}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ContainerHeight" x="110" y="0" width="220" height="20" uuid="06de3fd6-c3fd-4316-abcb-1a753e951b30">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{nom}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="330" y="0" width="185" height="20" uuid="2d7a2c15-346a-4977-896c-1ba29cfd5d53">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{arrondissement}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="515" y="0" width="145" height="20" uuid="4e3f26b4-15fe-4bb0-9fae-c912f47021fc">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{commune}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="660" y="0" width="140" height="20" uuid="0dcd7c23-f011-457e-a503-ce58f0bc710c">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{departement}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</detail>
|
||||||
|
<columnFooter>
|
||||||
|
<band height="45" splitType="Stretch"/>
|
||||||
|
</columnFooter>
|
||||||
|
<pageFooter>
|
||||||
|
<band height="54" splitType="Stretch"/>
|
||||||
|
</pageFooter>
|
||||||
|
<summary>
|
||||||
|
<band height="42" splitType="Stretch"/>
|
||||||
|
</summary>
|
||||||
|
</jasperReport>
|
||||||
419
jasperReport/listEnqueteParBloc.jrxml
Normal file
419
jasperReport/listEnqueteParBloc.jrxml
Normal file
@@ -0,0 +1,419 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Created with Jaspersoft Studio version 6.21.3.final using JasperReports Library version 6.21.3-4a3078d20785ebe464f18037d738d12fc98c13cf -->
|
||||||
|
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="listBlocParStructure" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="60393fd8-8f4e-44f7-8418-0139271081b1">
|
||||||
|
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit." value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
|
||||||
|
<parameter name="structure" class="java.lang.String"/>
|
||||||
|
<parameter name="logoDroit" class="java.lang.String"/>
|
||||||
|
<parameter name="logoGauche" class="java.lang.String"/>
|
||||||
|
<parameter name="bloc" class="java.lang.String"/>
|
||||||
|
<parameter name="arrondissement" class="java.lang.String"/>
|
||||||
|
<parameter name="commune" class="java.lang.String"/>
|
||||||
|
<queryString>
|
||||||
|
<![CDATA[]]>
|
||||||
|
</queryString>
|
||||||
|
<field name="nupProvisoire" class="java.lang.String"/>
|
||||||
|
<field name="quartier" class="java.lang.String"/>
|
||||||
|
<field name="q" class="java.lang.String"/>
|
||||||
|
<field name="i" class="java.lang.String"/>
|
||||||
|
<field name="p" class="java.lang.String"/>
|
||||||
|
<field name="nature" class="java.lang.String"/>
|
||||||
|
<field name="nomProprietaire" class="java.lang.String"/>
|
||||||
|
<field name="telephone" class="java.lang.String"/>
|
||||||
|
<field name="litige" class="java.lang.Boolean"/>
|
||||||
|
<background>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</background>
|
||||||
|
<title>
|
||||||
|
<band height="170" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="302" y="70" width="190" height="30" uuid="10a08362-9a39-4235-a0d1-33a733f0861e"/>
|
||||||
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
|
<font size="16" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[LISTE DES ENQUETES]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="0" y="112" width="120" height="20" uuid="4368e598-76c3-4ad7-867e-c3c9efe5ebd8"/>
|
||||||
|
<textElement textAlignment="Left" verticalAlignment="Middle">
|
||||||
|
<font size="14" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Structure :]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField >
|
||||||
|
<reportElement x="120" y="112" width="260" height="20" uuid="890f9a0d-98c7-4acd-becc-ea41d147c44d"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="12"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$P{structure}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<image>
|
||||||
|
<reportElement x="0" y="0" width="200" height="70" uuid="e194874d-8732-48bc-b829-5eee66cd557d"/>
|
||||||
|
<imageExpression><![CDATA[$P{logoGauche}]]></imageExpression>
|
||||||
|
</image>
|
||||||
|
<textField >
|
||||||
|
<reportElement x="470" y="112" width="330" height="20" uuid="e89fe5e8-8c95-465a-963a-38c89fe7b45c"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="14"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$P{bloc}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="380" y="112" width="90" height="20" uuid="78fbd365-5e80-486f-8b79-fba9f57ff757"/>
|
||||||
|
<textElement textAlignment="Left" verticalAlignment="Middle">
|
||||||
|
<font size="14" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Bloc :]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="380" y="150" width="90" height="20" uuid="104de4fb-c535-4e31-a61b-a5c5066de836"/>
|
||||||
|
<textElement textAlignment="Left" verticalAlignment="Middle">
|
||||||
|
<font size="14" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Commune :]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField >
|
||||||
|
<reportElement x="470" y="150" width="330" height="20" uuid="7944bfcb-94e3-4fc3-b717-a65820dd64de"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="14"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$P{commune}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</title>
|
||||||
|
<pageHeader>
|
||||||
|
<band height="19" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="0" y="-18" width="140" height="20" uuid="cb339471-8d6f-446d-9059-97e0f108bbde"/>
|
||||||
|
<textElement textAlignment="Left" verticalAlignment="Middle">
|
||||||
|
<font size="14" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Arrondissement :]]></text>
|
||||||
|
</staticText>
|
||||||
|
<textField >
|
||||||
|
<reportElement x="140" y="-18" width="240" height="20" uuid="f187b92d-cabc-4fbf-afae-7ac6d04d0dd6"/>
|
||||||
|
<textElement>
|
||||||
|
<font size="14"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$P{arrondissement}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</pageHeader>
|
||||||
|
<columnHeader>
|
||||||
|
<band height="20" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="0" y="0" width="110" height="20" backcolor="#E6E3E3" uuid="331a2555-93cf-45c8-b0b5-7b2852a4d2f3">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6ac9f7a7-6945-49f9-bb3f-304b676fe0cc"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[NUP Provisoire]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="110" y="0" width="120" height="20" backcolor="#E6E3E3" uuid="c4d92ed2-0221-46f2-927d-b475c27e868f">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Quartier]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="230" y="0" width="50" height="20" backcolor="#E6E3E3" uuid="2afc91ad-3b7c-4095-a7fc-971d233e3a80">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Q]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="280" y="0" width="40" height="20" backcolor="#E6E3E3" uuid="86774042-75a8-480b-8cee-b051aaf448f3">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[I]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="320" y="0" width="50" height="20" backcolor="#E6E3E3" uuid="c083896b-34f1-4034-8422-171bac20fa8b">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[P]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="370" y="0" width="60" height="20" backcolor="#E6E3E3" uuid="43fae784-98c5-4c75-bb0a-11f364bce22f">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Litige]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="430" y="0" width="114" height="20" backcolor="#E6E3E3" uuid="6fb97069-4150-4b4d-a7e4-110f7275e530">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Nature Domaine]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="544" y="0" width="156" height="20" backcolor="#E6E3E3" uuid="b609f024-82e7-491d-8558-ad6010c18cb6">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Nom Propriétaire]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="700" y="0" width="100" height="20" backcolor="#E6E3E3" uuid="4f3d245d-16c5-4992-81b9-f7de8d10ed45">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Téléphone]]></text>
|
||||||
|
</staticText>
|
||||||
|
</band>
|
||||||
|
</columnHeader>
|
||||||
|
<detail>
|
||||||
|
<band height="20" splitType="Stretch">
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="0" y="0" width="110" height="20" uuid="1d95f143-1f8d-4f69-a9fe-e35b552a3e90">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6ac9f7a7-6945-49f9-bb3f-304b676fe0cc"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{nupProvisoire}==null ? "" : $F{nupProvisoire}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ContainerHeight" x="110" y="0" width="120" height="20" uuid="06de3fd6-c3fd-4316-abcb-1a753e951b30">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{quartier}==null ? "": $F{quartier}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="230" y="0" width="50" height="20" uuid="2d7a2c15-346a-4977-896c-1ba29cfd5d53">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{q}==null ? "" : $F{q}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="280" y="0" width="40" height="20" uuid="4e3f26b4-15fe-4bb0-9fae-c912f47021fc">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{i} == null ? "" : $F{i}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="320" y="0" width="50" height="20" uuid="0dcd7c23-f011-457e-a503-ce58f0bc710c">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{p} == null ? "" : $F{p}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="370" y="0" width="60" height="20" uuid="5d6015a1-12af-4979-9b77-576cb6c99c05">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{litige}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="430" y="0" width="114" height="20" uuid="5880e9de-e658-4cda-b737-0d1e791fff8c">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{nature}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="544" y="0" width="156" height="20" uuid="34bb5d2b-4841-49b0-a7fa-83217ce30dda">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{nomProprietaire} == null ? "" : $F{nomProprietaire}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="700" y="0" width="100" height="20" uuid="beeb4530-5e7b-4759-a5ff-b8f2a4115d6d">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="12"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{telephone} == null ? "" : $F{telephone}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</detail>
|
||||||
|
<columnFooter>
|
||||||
|
<band height="45" splitType="Stretch"/>
|
||||||
|
</columnFooter>
|
||||||
|
<pageFooter>
|
||||||
|
<band height="54" splitType="Stretch"/>
|
||||||
|
</pageFooter>
|
||||||
|
<summary>
|
||||||
|
<band height="42" splitType="Stretch"/>
|
||||||
|
</summary>
|
||||||
|
</jasperReport>
|
||||||
396
jasperReport/listEnqueteParFiltre.jrxml
Normal file
396
jasperReport/listEnqueteParFiltre.jrxml
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Created with Jaspersoft Studio version 6.21.3.final using JasperReports Library version 6.21.3-4a3078d20785ebe464f18037d738d12fc98c13cf -->
|
||||||
|
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="listBlocParStructure" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="60393fd8-8f4e-44f7-8418-0139271081b1">
|
||||||
|
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit." value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
|
||||||
|
<parameter name="structure" class="java.lang.String"/>
|
||||||
|
<parameter name="logoDroit" class="java.lang.String"/>
|
||||||
|
<parameter name="logoGauche" class="java.lang.String"/>
|
||||||
|
<parameter name="bloc" class="java.lang.String"/>
|
||||||
|
<parameter name="arrondissement" class="java.lang.String"/>
|
||||||
|
<parameter name="commune" class="java.lang.String"/>
|
||||||
|
<queryString>
|
||||||
|
<![CDATA[]]>
|
||||||
|
</queryString>
|
||||||
|
<field name="nupprovisoire" class="java.lang.String"/>
|
||||||
|
<field name="communenom" class="java.lang.String"/>
|
||||||
|
<field name="arrondissementnom" class="java.lang.String"/>
|
||||||
|
<field name="blocnom" class="java.lang.String"/>
|
||||||
|
<field name="naturedomaine" class="java.lang.String"/>
|
||||||
|
<field name="prenomraisonsociale" class="java.lang.String"/>
|
||||||
|
<field name="litige" class="java.lang.Boolean"/>
|
||||||
|
<field name="structurenom" class="java.lang.String"/>
|
||||||
|
<field name="statusenquete" class="java.lang.String"/>
|
||||||
|
<field name="nomsigle" class="java.lang.String"/>
|
||||||
|
<field name="typepersonne" class="java.lang.String"/>
|
||||||
|
<background>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</background>
|
||||||
|
<title>
|
||||||
|
<band height="106" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="240" y="70" width="400" height="30" uuid="10a08362-9a39-4235-a0d1-33a733f0861e"/>
|
||||||
|
<textElement textAlignment="Center" verticalAlignment="Middle">
|
||||||
|
<font size="16" isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[LISTE DES ENQUETES]]></text>
|
||||||
|
</staticText>
|
||||||
|
<image>
|
||||||
|
<reportElement x="0" y="0" width="200" height="70" uuid="e194874d-8732-48bc-b829-5eee66cd557d"/>
|
||||||
|
<imageExpression><![CDATA[$P{logoGauche}]]></imageExpression>
|
||||||
|
</image>
|
||||||
|
</band>
|
||||||
|
</title>
|
||||||
|
<pageHeader>
|
||||||
|
<band height="19" splitType="Stretch"/>
|
||||||
|
</pageHeader>
|
||||||
|
<columnHeader>
|
||||||
|
<band height="20" splitType="Stretch">
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="0" y="0" width="70" height="20" backcolor="#E6E3E3" uuid="331a2555-93cf-45c8-b0b5-7b2852a4d2f3">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6ac9f7a7-6945-49f9-bb3f-304b676fe0cc"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[NUP Provisoire]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="200" y="0" width="70" height="20" backcolor="#E6E3E3" uuid="c4d92ed2-0221-46f2-927d-b475c27e868f">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Commune]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="270" y="0" width="80" height="20" backcolor="#E6E3E3" uuid="2afc91ad-3b7c-4095-a7fc-971d233e3a80">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Arrondissement]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="350" y="0" width="80" height="20" backcolor="#E6E3E3" uuid="86774042-75a8-480b-8cee-b051aaf448f3">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Bloc]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="430" y="0" width="70" height="20" backcolor="#E6E3E3" uuid="c083896b-34f1-4034-8422-171bac20fa8b">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Structure]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="140" y="0" width="60" height="20" backcolor="#E6E3E3" uuid="43fae784-98c5-4c75-bb0a-11f364bce22f">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Litige]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="70" y="0" width="70" height="20" backcolor="#E6E3E3" uuid="6fb97069-4150-4b4d-a7e4-110f7275e530">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Nature Domaine]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="590" y="0" width="110" height="20" backcolor="#E6E3E3" uuid="b609f024-82e7-491d-8558-ad6010c18cb6">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Nom Propriétaire]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="700" y="0" width="100" height="20" backcolor="#E6E3E3" uuid="4f3d245d-16c5-4992-81b9-f7de8d10ed45">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Statut]]></text>
|
||||||
|
</staticText>
|
||||||
|
<staticText>
|
||||||
|
<reportElement mode="Opaque" x="500" y="0" width="90" height="20" backcolor="#E6E3E3" uuid="3a10eece-e81b-408b-b680-d7f31c9931a1">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<topPen lineWidth="0.25"/>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8" isBold="true"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<text><![CDATA[Type de personne]]></text>
|
||||||
|
</staticText>
|
||||||
|
</band>
|
||||||
|
</columnHeader>
|
||||||
|
<detail>
|
||||||
|
<band height="20" splitType="Stretch">
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="0" y="0" width="70" height="20" uuid="1d95f143-1f8d-4f69-a9fe-e35b552a3e90">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6ac9f7a7-6945-49f9-bb3f-304b676fe0cc"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{nupprovisoire}==null ? "" : $F{nupprovisoire}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ContainerHeight" x="200" y="0" width="70" height="20" uuid="06de3fd6-c3fd-4316-abcb-1a753e951b30">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6a576dff-c575-4984-bac4-07e6f9e677d7"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.width" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{communenom}==null ? "": $F{communenom}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="270" y="0" width="80" height="20" uuid="2d7a2c15-346a-4977-896c-1ba29cfd5d53">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{arrondissementnom}==null ? "" : $F{arrondissementnom}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="350" y="0" width="80" height="20" uuid="4e3f26b4-15fe-4bb0-9fae-c912f47021fc">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{blocnom} == null ? "" : $F{blocnom}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="430" y="0" width="70" height="20" uuid="0dcd7c23-f011-457e-a503-ce58f0bc710c">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{structurenom}== null ? "" : $F{structurenom}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="140" y="0" width="60" height="20" uuid="5d6015a1-12af-4979-9b77-576cb6c99c05">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{litige}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="70" y="0" width="70" height="20" uuid="5880e9de-e658-4cda-b737-0d1e791fff8c">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{naturedomaine}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="590" y="0" width="110" height="20" uuid="34bb5d2b-4841-49b0-a7fa-83217ce30dda">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{prenomraisonsociale} +" "+ $F{nomsigle}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="700" y="0" width="100" height="20" uuid="beeb4530-5e7b-4759-a5ff-b8f2a4115d6d">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{statusenquete} == null ? "" : $F{statusenquete}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField >
|
||||||
|
<reportElement stretchType="ElementGroupHeight" x="500" y="0" width="90" height="20" uuid="28eac03c-0024-4451-9e95-b755a6cb6cb7">
|
||||||
|
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bbc2af97-f9e1-4d01-8bda-9ea636f952d0"/>
|
||||||
|
<property name="com.jaspersoft.studio.unit.leftIndent" value="px"/>
|
||||||
|
</reportElement>
|
||||||
|
<box>
|
||||||
|
<leftPen lineWidth="0.25"/>
|
||||||
|
<bottomPen lineWidth="0.25"/>
|
||||||
|
<rightPen lineWidth="0.25"/>
|
||||||
|
</box>
|
||||||
|
<textElement verticalAlignment="Middle">
|
||||||
|
<font size="8"/>
|
||||||
|
<paragraph leftIndent="10"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$F{typepersonne}== null ? "" : $F{typepersonne}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</detail>
|
||||||
|
<columnFooter>
|
||||||
|
<band height="45" splitType="Stretch"/>
|
||||||
|
</columnFooter>
|
||||||
|
<pageFooter>
|
||||||
|
<band height="54" splitType="Stretch"/>
|
||||||
|
</pageFooter>
|
||||||
|
<summary>
|
||||||
|
<band height="42" splitType="Stretch"/>
|
||||||
|
</summary>
|
||||||
|
</jasperReport>
|
||||||
310
mvnw
vendored
Executable file
310
mvnw
vendored
Executable file
@@ -0,0 +1,310 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Maven Start Up Batch script
|
||||||
|
#
|
||||||
|
# Required ENV vars:
|
||||||
|
# ------------------
|
||||||
|
# JAVA_HOME - location of a JDK home dir
|
||||||
|
#
|
||||||
|
# Optional ENV vars
|
||||||
|
# -----------------
|
||||||
|
# M2_HOME - location of maven2's installed home dir
|
||||||
|
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
# e.g. to debug Maven itself, use
|
||||||
|
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||||
|
|
||||||
|
if [ -f /etc/mavenrc ] ; then
|
||||||
|
. /etc/mavenrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f "$HOME/.mavenrc" ] ; then
|
||||||
|
. "$HOME/.mavenrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# OS specific support. $var _must_ be set to either true or false.
|
||||||
|
cygwin=false;
|
||||||
|
darwin=false;
|
||||||
|
mingw=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN*) cygwin=true ;;
|
||||||
|
MINGW*) mingw=true;;
|
||||||
|
Darwin*) darwin=true
|
||||||
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||||
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
if [ -x "/usr/libexec/java_home" ]; then
|
||||||
|
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||||
|
else
|
||||||
|
export JAVA_HOME="/Library/Java/Home"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
if [ -r /etc/gentoo-release ] ; then
|
||||||
|
JAVA_HOME=`java-config --jre-home`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$M2_HOME" ] ; then
|
||||||
|
## resolve links - $0 may be a link to maven's home
|
||||||
|
PRG="$0"
|
||||||
|
|
||||||
|
# need this for relative symlinks
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG="`dirname "$PRG"`/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
saveddir=`pwd`
|
||||||
|
|
||||||
|
M2_HOME=`dirname "$PRG"`/..
|
||||||
|
|
||||||
|
# make it fully qualified
|
||||||
|
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||||
|
|
||||||
|
cd "$saveddir"
|
||||||
|
# echo Using m2 at $M2_HOME
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $cygwin ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||||
|
if $mingw ; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ]; then
|
||||||
|
javaExecutable="`which javac`"
|
||||||
|
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||||
|
# readlink(1) is not available as standard on Solaris 10.
|
||||||
|
readLink=`which readlink`
|
||||||
|
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||||
|
if $darwin ; then
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||||
|
else
|
||||||
|
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||||
|
fi
|
||||||
|
javaHome="`dirname \"$javaExecutable\"`"
|
||||||
|
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||||
|
JAVA_HOME="$javaHome"
|
||||||
|
export JAVA_HOME
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVACMD" ] ; then
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="`which java`"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||||
|
echo " We cannot execute $JAVACMD" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$JAVA_HOME" ] ; then
|
||||||
|
echo "Warning: JAVA_HOME environment variable is not set."
|
||||||
|
fi
|
||||||
|
|
||||||
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||||
|
|
||||||
|
# traverses directory structure from process work directory to filesystem root
|
||||||
|
# first directory with .mvn subdirectory is considered project base directory
|
||||||
|
find_maven_basedir() {
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "Path not specified to find_maven_basedir"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
basedir="$1"
|
||||||
|
wdir="$1"
|
||||||
|
while [ "$wdir" != '/' ] ; do
|
||||||
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
|
basedir=$wdir
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||||
|
if [ -d "${wdir}" ]; then
|
||||||
|
wdir=`cd "$wdir/.."; pwd`
|
||||||
|
fi
|
||||||
|
# end of workaround
|
||||||
|
done
|
||||||
|
echo "${basedir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# concatenates all lines of a file
|
||||||
|
concat_lines() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
echo "$(tr -s '\n' ' ' < "$1")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||||
|
if [ -z "$BASE_DIR" ]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
##########################################################################################
|
||||||
|
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
##########################################################################################
|
||||||
|
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||||
|
fi
|
||||||
|
if [ -n "$MVNW_REPOURL" ]; then
|
||||||
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
else
|
||||||
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
fi
|
||||||
|
while IFS="=" read key value; do
|
||||||
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||||
|
esac
|
||||||
|
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Downloading from: $jarUrl"
|
||||||
|
fi
|
||||||
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||||
|
if $cygwin; then
|
||||||
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v wget > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found wget ... using wget"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
wget "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
else
|
||||||
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||||
|
fi
|
||||||
|
elif command -v curl > /dev/null; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Found curl ... using curl"
|
||||||
|
fi
|
||||||
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||||
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
else
|
||||||
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo "Falling back to using Java to download"
|
||||||
|
fi
|
||||||
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||||
|
# For Cygwin, switch paths to Windows format before running javac
|
||||||
|
if $cygwin; then
|
||||||
|
javaClass=`cygpath --path --windows "$javaClass"`
|
||||||
|
fi
|
||||||
|
if [ -e "$javaClass" ]; then
|
||||||
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
# Compiling the Java class
|
||||||
|
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||||
|
fi
|
||||||
|
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||||
|
# Running the downloader
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo " - Running MavenWrapperDownloader.java ..."
|
||||||
|
fi
|
||||||
|
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
##########################################################################################
|
||||||
|
# End of extension
|
||||||
|
##########################################################################################
|
||||||
|
|
||||||
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||||
|
if [ "$MVNW_VERBOSE" = true ]; then
|
||||||
|
echo $MAVEN_PROJECTBASEDIR
|
||||||
|
fi
|
||||||
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin; then
|
||||||
|
[ -n "$M2_HOME" ] &&
|
||||||
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||||
|
[ -n "$JAVA_HOME" ] &&
|
||||||
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||||
|
[ -n "$CLASSPATH" ] &&
|
||||||
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||||
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||||
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
# work with both Windows and non-Windows executions.
|
||||||
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||||
|
export MAVEN_CMD_LINE_ARGS
|
||||||
|
|
||||||
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
exec "$JAVACMD" \
|
||||||
|
$MAVEN_OPTS \
|
||||||
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||||
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||||
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||||
182
mvnw.cmd
vendored
Executable file
182
mvnw.cmd
vendored
Executable file
@@ -0,0 +1,182 @@
|
|||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
@REM or more contributor license agreements. See the NOTICE file
|
||||||
|
@REM distributed with this work for additional information
|
||||||
|
@REM regarding copyright ownership. The ASF licenses this file
|
||||||
|
@REM to you under the Apache License, Version 2.0 (the
|
||||||
|
@REM "License"); you may not use this file except in compliance
|
||||||
|
@REM with the License. You may obtain a copy of the License at
|
||||||
|
@REM
|
||||||
|
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
@REM
|
||||||
|
@REM Unless required by applicable law or agreed to in writing,
|
||||||
|
@REM software distributed under the License is distributed on an
|
||||||
|
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
@REM KIND, either express or implied. See the License for the
|
||||||
|
@REM specific language governing permissions and limitations
|
||||||
|
@REM under the License.
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
@REM Maven Start Up Batch script
|
||||||
|
@REM
|
||||||
|
@REM Required ENV vars:
|
||||||
|
@REM JAVA_HOME - location of a JDK home dir
|
||||||
|
@REM
|
||||||
|
@REM Optional ENV vars
|
||||||
|
@REM M2_HOME - location of maven2's installed home dir
|
||||||
|
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||||
|
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||||
|
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||||
|
@REM e.g. to debug Maven itself, use
|
||||||
|
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||||
|
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||||
|
@REM ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||||
|
@echo off
|
||||||
|
@REM set title of command window
|
||||||
|
title %0
|
||||||
|
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||||
|
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||||
|
|
||||||
|
@REM set %HOME% to equivalent of $HOME
|
||||||
|
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||||
|
|
||||||
|
@REM Execute a user defined script before this one
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||||
|
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||||
|
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||||
|
:skipRcPre
|
||||||
|
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
set ERROR_CODE=0
|
||||||
|
|
||||||
|
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||||
|
@setlocal
|
||||||
|
|
||||||
|
@REM ==== START VALIDATION ====
|
||||||
|
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME not found in your environment. >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
:OkJHome
|
||||||
|
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||||
|
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||||
|
echo location of your Java installation. >&2
|
||||||
|
echo.
|
||||||
|
goto error
|
||||||
|
|
||||||
|
@REM ==== END VALIDATION ====
|
||||||
|
|
||||||
|
:init
|
||||||
|
|
||||||
|
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||||
|
@REM Fallback to current working directory if not found.
|
||||||
|
|
||||||
|
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||||
|
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||||
|
|
||||||
|
set EXEC_DIR=%CD%
|
||||||
|
set WDIR=%EXEC_DIR%
|
||||||
|
:findBaseDir
|
||||||
|
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||||
|
cd ..
|
||||||
|
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||||
|
set WDIR=%CD%
|
||||||
|
goto findBaseDir
|
||||||
|
|
||||||
|
:baseDirFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
goto endDetectBaseDir
|
||||||
|
|
||||||
|
:baseDirNotFound
|
||||||
|
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||||
|
cd "%EXEC_DIR%"
|
||||||
|
|
||||||
|
:endDetectBaseDir
|
||||||
|
|
||||||
|
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||||
|
|
||||||
|
@setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||||
|
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||||
|
|
||||||
|
:endReadAdditionalConfig
|
||||||
|
|
||||||
|
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||||
|
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||||
|
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||||
|
|
||||||
|
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
|
||||||
|
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||||
|
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||||
|
)
|
||||||
|
|
||||||
|
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||||
|
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||||
|
if exist %WRAPPER_JAR% (
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Found %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
if not "%MVNW_REPOURL%" == "" (
|
||||||
|
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||||
|
)
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||||
|
echo Downloading from: %DOWNLOAD_URL%
|
||||||
|
)
|
||||||
|
|
||||||
|
powershell -Command "&{"^
|
||||||
|
"$webclient = new-object System.Net.WebClient;"^
|
||||||
|
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||||
|
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||||
|
"}"^
|
||||||
|
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||||
|
"}"
|
||||||
|
if "%MVNW_VERBOSE%" == "true" (
|
||||||
|
echo Finished downloading %WRAPPER_JAR%
|
||||||
|
)
|
||||||
|
)
|
||||||
|
@REM End of extension
|
||||||
|
|
||||||
|
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||||
|
@REM work with both Windows and non-Windows executions.
|
||||||
|
set MAVEN_CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
|
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||||
|
if ERRORLEVEL 1 goto error
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
set ERROR_CODE=1
|
||||||
|
|
||||||
|
:end
|
||||||
|
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||||
|
|
||||||
|
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||||
|
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||||
|
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||||
|
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||||
|
:skipRcPost
|
||||||
|
|
||||||
|
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||||
|
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||||
|
|
||||||
|
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||||
|
|
||||||
|
exit /B %ERROR_CODE%
|
||||||
144
pom.xml
Executable file
144
pom.xml
Executable file
@@ -0,0 +1,144 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<relativePath/>
|
||||||
|
</parent>
|
||||||
|
<groupId>io.gmss</groupId>
|
||||||
|
<artifactId>Fiscad</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<name>fiscad</name>
|
||||||
|
<description>Application de collecte des données socio-foncières</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>11</java.version>
|
||||||
|
<spring-cloud.version>2020.0.3</spring-cloud.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.30</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-oas</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt</artifactId>
|
||||||
|
<version>0.9.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.sf.jasperreports</groupId>
|
||||||
|
<artifactId>jasperreports</artifactId>
|
||||||
|
<version>6.21.3</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.lowagie</groupId>
|
||||||
|
<artifactId>itext</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.lowagie</groupId>
|
||||||
|
<artifactId>itext</artifactId>
|
||||||
|
<version>2.1.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.groovy</groupId>
|
||||||
|
<artifactId>groovy-all</artifactId>
|
||||||
|
<version>2.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--Dépendance géométry
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.locationtech.jts</groupId>
|
||||||
|
<artifactId>jts-core</artifactId>
|
||||||
|
<version>1.16.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-spatial</artifactId>
|
||||||
|
<version>${hibernate.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.hibernate</groupId>
|
||||||
|
<artifactId>hibernate-envers</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.n52.jackson</groupId>
|
||||||
|
<artifactId>jackson-datatype-jts</artifactId>
|
||||||
|
<version>1.2.4</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.teiid</groupId>
|
||||||
|
<artifactId>teiid-optional-geo</artifactId>
|
||||||
|
<version>16.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
dependance geometry-->
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>${spring-cloud.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
22
src/main/java/io/gmss/infocad/FiscadApplication.java
Executable file
22
src/main/java/io/gmss/infocad/FiscadApplication.java
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
package io.gmss.infocad;
|
||||||
|
|
||||||
|
import org.springframework.boot.CommandLineRunner;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||||
|
import springfox.documentation.oas.annotations.EnableOpenApi;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableOpenApi
|
||||||
|
@ConfigurationPropertiesScan
|
||||||
|
public class FiscadApplication implements CommandLineRunner {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(FiscadApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(String... args) throws Exception {
|
||||||
|
System.out.println("InfoCad Application start completed");
|
||||||
|
}
|
||||||
|
}
|
||||||
72
src/main/java/io/gmss/infocad/component/DataLoadConfig.java
Executable file
72
src/main/java/io/gmss/infocad/component/DataLoadConfig.java
Executable file
@@ -0,0 +1,72 @@
|
|||||||
|
package io.gmss.infocad.component;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.user.Role;
|
||||||
|
import io.gmss.infocad.entities.user.User;
|
||||||
|
import io.gmss.infocad.enums.UserRole;
|
||||||
|
import io.gmss.infocad.repositories.user.RoleRepository;
|
||||||
|
import io.gmss.infocad.repositories.user.UserRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class DataLoadConfig {
|
||||||
|
|
||||||
|
private final RoleRepository roleRepository;
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
private final PasswordEncoder passwordEncoder;
|
||||||
|
|
||||||
|
@Value("${app.sourcemind.env.defaultpassword}")
|
||||||
|
private String defaultPassword;
|
||||||
|
|
||||||
|
public DataLoadConfig(RoleRepository roleRepository, UserRepository userRepository, PasswordEncoder passwordEncoder) {
|
||||||
|
this.roleRepository = roleRepository;
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
this.passwordEncoder = passwordEncoder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void loadData(){
|
||||||
|
loadRoles();
|
||||||
|
loadUsers();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void loadRoles(){
|
||||||
|
|
||||||
|
if(roleRepository.count() > 0) return;
|
||||||
|
Set<Role> roles = new HashSet<>();
|
||||||
|
roles.add(new Role(UserRole.ROLE_USER, "Role attribué aux utilisateurs simples."));
|
||||||
|
roles.add(new Role(UserRole.ROLE_ADMIN, "Role attribué aux administrateurs du système."));
|
||||||
|
roles.add(new Role(UserRole.ROLE_DIRECTEUR, "Role attribué aux directeurs des structures."));
|
||||||
|
roles.add(new Role(UserRole.ROLE_SUPERVISEUR, "Role attribué aux superviseurs des structures sur le terrain."));
|
||||||
|
roles.add(new Role(UserRole.ROLE_ENQUETEUR, "Role attribué aux enquêteurs des structures sur le terrain."));
|
||||||
|
roles.add(new Role(UserRole.ROLE_ANONYMOUS, "Role attribué à toutes les personnes qui s'inscrivent en ligne pour le compte d'une structure."));
|
||||||
|
roleRepository.saveAll(roles);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void loadUsers(){
|
||||||
|
if(userRepository.countAllByUsernameIsNotNull() == 0) {
|
||||||
|
User admin = new User();
|
||||||
|
admin.setUsername("administrateur@infocad.bj");
|
||||||
|
admin.setEmail("administrateur@infocad.bj");
|
||||||
|
admin.setTel("N/A");
|
||||||
|
admin.setNom("Administrateur");
|
||||||
|
admin.setPrenom("Principal");
|
||||||
|
admin.setPassword(passwordEncoder.encode(defaultPassword));
|
||||||
|
admin.setActive(true);
|
||||||
|
Set<Role> roles = new HashSet<>();
|
||||||
|
roles.add(roleRepository.findRoleByNom(UserRole.ROLE_ADMIN).get());
|
||||||
|
admin.setRoles(roles);
|
||||||
|
userRepository.save(admin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
26
src/main/java/io/gmss/infocad/configuration/AuditConfig.java
Executable file
26
src/main/java/io/gmss/infocad/configuration/AuditConfig.java
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
package io.gmss.infocad.configuration;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.repositories.user.UserRepository;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.data.domain.AuditorAware;
|
||||||
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableJpaAuditing(auditorAwareRef = "auditorProvider")
|
||||||
|
public class AuditConfig {
|
||||||
|
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
|
||||||
|
public AuditConfig(UserRepository userRepository) {
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public AuditorAware<Long> auditorProvider() {
|
||||||
|
return new AuditorAwareImpl(userRepository);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
32
src/main/java/io/gmss/infocad/configuration/AuditorAwareImpl.java
Executable file
32
src/main/java/io/gmss/infocad/configuration/AuditorAwareImpl.java
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
package io.gmss.infocad.configuration;
|
||||||
|
|
||||||
|
import io.gmss.infocad.repositories.user.UserRepository;
|
||||||
|
import io.gmss.infocad.security.UserPrincipal;
|
||||||
|
import org.springframework.data.domain.AuditorAware;
|
||||||
|
import org.springframework.security.authentication.AnonymousAuthenticationToken;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class AuditorAwareImpl implements AuditorAware<Long> {
|
||||||
|
|
||||||
|
private final UserRepository userRepository;
|
||||||
|
|
||||||
|
public AuditorAwareImpl(UserRepository userRepository) {
|
||||||
|
this.userRepository = userRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<Long> getCurrentAuditor() {
|
||||||
|
|
||||||
|
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||||
|
|
||||||
|
if(authentication == null || !authentication.isAuthenticated() || authentication instanceof AnonymousAuthenticationToken){
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
UserPrincipal userPrincipal = (UserPrincipal) authentication.getPrincipal();
|
||||||
|
//return userRepository.findByUsername(userPrincipal.getUsername()).get().getId();
|
||||||
|
return Optional.ofNullable(userPrincipal.getUser().getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/java/io/gmss/infocad/configuration/JdbcConfig.java
Normal file
16
src/main/java/io/gmss/infocad/configuration/JdbcConfig.java
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package io.gmss.infocad.configuration;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JdbcConfig {
|
||||||
|
@Bean
|
||||||
|
public JdbcTemplate jdbcTemplate(DataSource dataSource)
|
||||||
|
{
|
||||||
|
return new JdbcTemplate(dataSource);
|
||||||
|
}
|
||||||
|
}
|
||||||
208
src/main/java/io/gmss/infocad/configuration/SpringSecurityConfig.java
Executable file
208
src/main/java/io/gmss/infocad/configuration/SpringSecurityConfig.java
Executable file
@@ -0,0 +1,208 @@
|
|||||||
|
//package io.artcreativity.ifudistribution.config;
|
||||||
|
//
|
||||||
|
//import io.artcreativity.ifudistribution.security.CustomUserDetailsService;
|
||||||
|
//import io.artcreativity.ifudistribution.security.JwtAuthenticationEntryPoint;
|
||||||
|
//import io.artcreativity.ifudistribution.security.JwtAuthenticationFilter;
|
||||||
|
//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.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;
|
||||||
|
//
|
||||||
|
//@EnableWebSecurity
|
||||||
|
//@Configuration
|
||||||
|
//public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
//
|
||||||
|
// private final CustomUserDetailsService customUserDetailsService;
|
||||||
|
// private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
|
||||||
|
//
|
||||||
|
// public SpringSecurityConfig(CustomUserDetailsService customUserDetailsService, JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint) {
|
||||||
|
// this.customUserDetailsService = customUserDetailsService;
|
||||||
|
// this.jwtAuthenticationEntryPoint = jwtAuthenticationEntryPoint;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
|
//// auth.userDetailsService(customUserDetailsService)
|
||||||
|
//// .passwordEncoder(getPasswordEncoder());
|
||||||
|
//
|
||||||
|
// auth
|
||||||
|
// .ldapAuthentication()
|
||||||
|
// .userDnPatterns("uid={0},ou=people")
|
||||||
|
// .groupSearchBase("ou=groups")
|
||||||
|
// .contextSource()
|
||||||
|
// .url("ldap://localhost:5645/dc=artcreativity,dc=io")
|
||||||
|
// .and()
|
||||||
|
// .passwordCompare()
|
||||||
|
// .passwordEncoder(getPasswordEncoder())
|
||||||
|
// .passwordAttribute("userPassword");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean(BeanIds.AUTHENTICATION_MANAGER)
|
||||||
|
// @Override
|
||||||
|
// public AuthenticationManager authenticationManagerBean() throws Exception{
|
||||||
|
// return super.authenticationManagerBean();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean
|
||||||
|
// public PasswordEncoder getPasswordEncoder(){
|
||||||
|
// return new BCryptPasswordEncoder();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean
|
||||||
|
// JwtAuthenticationFilter jwtAuthenticationFilter(){
|
||||||
|
// return new JwtAuthenticationFilter();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private static final String[] AUTH_WHITELIST = {
|
||||||
|
//
|
||||||
|
// // -- swagger ui
|
||||||
|
// "/swagger-resources/**",
|
||||||
|
// "/swagger-ui.html",
|
||||||
|
// "/swagger-ui/**",
|
||||||
|
// "/springfox/**",
|
||||||
|
// "/v3/api-docs",
|
||||||
|
// "/v2/api-docs",
|
||||||
|
// "/webjars/**",
|
||||||
|
// "/api/auth/**",
|
||||||
|
// "/api/contribuable/**",
|
||||||
|
// "/api/auth/login"
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void configure(HttpSecurity http) throws Exception {
|
||||||
|
// http
|
||||||
|
// .cors()
|
||||||
|
// .and()
|
||||||
|
// .csrf()
|
||||||
|
// .disable()
|
||||||
|
// .exceptionHandling()
|
||||||
|
// .authenticationEntryPoint(jwtAuthenticationEntryPoint)
|
||||||
|
// .and()
|
||||||
|
//// .sessionManagement()
|
||||||
|
//// .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||||
|
//// .and()
|
||||||
|
// .authorizeRequests()
|
||||||
|
// .antMatchers("/",
|
||||||
|
// "/favicon.ico",
|
||||||
|
// "/**/*.png",
|
||||||
|
// "/**/*.gif",
|
||||||
|
// "/**/*.svg",
|
||||||
|
// "/**/*.jpg",
|
||||||
|
// "/**/*.html",
|
||||||
|
// "/**/*.css",
|
||||||
|
// "/**/*.js")
|
||||||
|
// .permitAll()
|
||||||
|
// .antMatchers(AUTH_WHITELIST).permitAll()
|
||||||
|
// .antMatchers(HttpMethod.GET, "/api/polls/**", "/api/users/**")
|
||||||
|
// .permitAll()
|
||||||
|
// .anyRequest()
|
||||||
|
// .authenticated();
|
||||||
|
//
|
||||||
|
// http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
|
||||||
|
package io.gmss.infocad.configuration;
|
||||||
|
|
||||||
|
import io.gmss.infocad.security.CustomUserDetailsService;
|
||||||
|
import io.gmss.infocad.security.JwtAuthenticationEntryPoint;
|
||||||
|
import io.gmss.infocad.security.JwtAuthenticationFilter;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@EnableWebSecurity
|
||||||
|
@Configuration
|
||||||
|
@EnableGlobalMethodSecurity(securedEnabled = true, jsr250Enabled = true, prePostEnabled = true)
|
||||||
|
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
|
private final CustomUserDetailsService customUserDetailsService;
|
||||||
|
private final JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint;
|
||||||
|
|
||||||
|
|
||||||
|
public SpringSecurityConfig(CustomUserDetailsService customUserDetailsService,
|
||||||
|
JwtAuthenticationEntryPoint jwtAuthenticationEntryPoint) {
|
||||||
|
this.customUserDetailsService = customUserDetailsService;
|
||||||
|
this.jwtAuthenticationEntryPoint = jwtAuthenticationEntryPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(AuthenticationManagerBuilder auth) throws Exception {
|
||||||
|
auth.userDetailsService(customUserDetailsService)
|
||||||
|
.passwordEncoder(getPasswordEncoder());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public PasswordEncoder getPasswordEncoder() {
|
||||||
|
return new BCryptPasswordEncoder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public JwtAuthenticationFilter jwtAuthenticationFilter() {
|
||||||
|
return new JwtAuthenticationFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean(BeanIds.AUTHENTICATION_MANAGER)
|
||||||
|
@Override
|
||||||
|
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||||
|
return super.authenticationManagerBean();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static final String[] AUTH_WHITELIST = {
|
||||||
|
|
||||||
|
// -- CSS and JS
|
||||||
|
"/","/favicon.ico","/**/*.png","/**/*.gif","/**/*.svg","/**/*.jpg","/**/*.html","/**/*.css","/**/*.js",
|
||||||
|
|
||||||
|
// -- swagger ui
|
||||||
|
"/v2/api-docs", "/configuration/**", "/swagger-resources/**", "/swagger-ui.html", "/swagger-ui/**", "/webjars/**", "/api-docs/**", "/springfox/**", "/v3/api-docs",
|
||||||
|
|
||||||
|
// -- Login
|
||||||
|
"/api/**"
|
||||||
|
//"/api/auth/**"
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure(HttpSecurity http) throws Exception {
|
||||||
|
|
||||||
|
http
|
||||||
|
.cors()
|
||||||
|
.and()
|
||||||
|
.csrf()
|
||||||
|
.disable()
|
||||||
|
.exceptionHandling()
|
||||||
|
.authenticationEntryPoint(jwtAuthenticationEntryPoint)
|
||||||
|
.and()
|
||||||
|
.sessionManagement()
|
||||||
|
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||||
|
.and()
|
||||||
|
.authorizeRequests()
|
||||||
|
.antMatchers(AUTH_WHITELIST)
|
||||||
|
.permitAll()
|
||||||
|
.anyRequest()
|
||||||
|
.authenticated();
|
||||||
|
|
||||||
|
|
||||||
|
http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
78
src/main/java/io/gmss/infocad/configuration/SwaggerConfig.java
Executable file
78
src/main/java/io/gmss/infocad/configuration/SwaggerConfig.java
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
package io.gmss.infocad.configuration;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
import springfox.documentation.service.ApiInfo;
|
||||||
|
import springfox.documentation.service.Contact;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
import springfox.documentation.swagger.web.*;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
//@Import(SpringDataRestConfiguration.class)
|
||||||
|
public class SwaggerConfig {
|
||||||
|
@Bean
|
||||||
|
public Docket api() {
|
||||||
|
return new Docket(DocumentationType.OAS_30)
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("io.gmss.infocad.controllers")).paths(PathSelectors.any()).build().apiInfo(this.getApiInfo());
|
||||||
|
// .securitySchemes(this.securitySchemes())
|
||||||
|
// .securityContexts(Arrays.asList(this.securityContext()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// public SecurityContext securityContext() {
|
||||||
|
// AuthorizationScope[] scopes = { new AuthorizationScope("read", "for read operation"),
|
||||||
|
// new AuthorizationScope("write", "for write operation") };
|
||||||
|
// List<SecurityReference> securityReferences = Arrays.asList(new SecurityReference("basicAuth", scopes),
|
||||||
|
// new SecurityReference("Key", scopes), new SecurityReference("Authorization", scopes));
|
||||||
|
// return SecurityContext.builder().securityReferences(securityReferences)
|
||||||
|
// .forPaths(PathSelectors.any())
|
||||||
|
// .build();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public List<SecurityScheme> securitySchemes() {
|
||||||
|
// // SecurityScheme basicAuth = new BasicAuth("basicAuth");
|
||||||
|
// SecurityScheme userAuthToken = new ApiKey("Authorization", "Authorization", "header");
|
||||||
|
// // SecurityScheme keyAuth = new ApiKey("Key", "Key", "header");
|
||||||
|
// return Arrays.asList(
|
||||||
|
// // keyAuth,
|
||||||
|
// userAuthToken
|
||||||
|
// //, basicAuth
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public UiConfiguration uiConfig() {
|
||||||
|
return UiConfigurationBuilder.builder()
|
||||||
|
.deepLinking(true)
|
||||||
|
.displayOperationId(false)
|
||||||
|
.defaultModelsExpandDepth(1)
|
||||||
|
.defaultModelExpandDepth(1)
|
||||||
|
.displayRequestDuration(false)
|
||||||
|
.docExpansion(DocExpansion.LIST) // Use 'LIST', 'FULL', or 'NONE'
|
||||||
|
.filter(false)
|
||||||
|
.maxDisplayedTags(100) // Set the maximum number of tags to display
|
||||||
|
.operationsSorter(OperationsSorter.ALPHA) // Use 'ALPHA' or 'METHOD'
|
||||||
|
.showExtensions(false)
|
||||||
|
.tagsSorter(TagsSorter.ALPHA) // Use 'ALPHA'
|
||||||
|
.validatorUrl(null)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiInfo getApiInfo() {
|
||||||
|
Contact contact = new Contact("INFOCAD", "https://gmss.com/", "contact@gmss.com");
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
.title("LIST OF API")
|
||||||
|
.description("This page show all ressources that you could handle to communicate with database via REST API.")
|
||||||
|
.version("1.0")
|
||||||
|
.license("INFOCAD v.1.0")
|
||||||
|
.licenseUrl("https://www.apache.org/licenses/LICENSE-3.0")
|
||||||
|
.contact(contact)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/main/java/io/gmss/infocad/configuration/WebConfig.java
Normal file
21
src/main/java/io/gmss/infocad/configuration/WebConfig.java
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package io.gmss.infocad.configuration;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableWebMvc
|
||||||
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
private final long MAX_AGE_SECS = 3600;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
|
registry.addMapping("/**")
|
||||||
|
.allowedOrigins("*")
|
||||||
|
.allowedMethods("HEAD", "OPTIONS", "GET", "POST", "PUT", "PATCH", "DELETE")
|
||||||
|
.maxAge(MAX_AGE_SECS);
|
||||||
|
}
|
||||||
|
}
|
||||||
47
src/main/java/io/gmss/infocad/controllers/OpenController.java
Executable file
47
src/main/java/io/gmss/infocad/controllers/OpenController.java
Executable file
@@ -0,0 +1,47 @@
|
|||||||
|
package io.gmss.infocad.controllers;
|
||||||
|
|
||||||
|
import net.sf.jasperreports.engine.JasperCompileManager;
|
||||||
|
import net.sf.jasperreports.engine.JasperReport;
|
||||||
|
import net.sf.jasperreports.engine.util.JRSaver;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/open", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class OpenController {
|
||||||
|
|
||||||
|
@Value("${file.jasper-reports}")
|
||||||
|
private String jaspersDir;
|
||||||
|
|
||||||
|
@GetMapping("/compile-report")
|
||||||
|
public ResponseEntity<?> compile(@RequestParam String jrxmlFileName) {
|
||||||
|
try{
|
||||||
|
InputStream quitusReportStream = getStream(jaspersDir + "/" + jrxmlFileName + ".jrxml");
|
||||||
|
JasperReport jasperReport = JasperCompileManager.compileReport(quitusReportStream);
|
||||||
|
JRSaver.saveObject(jasperReport, jaspersDir + "/" + jrxmlFileName + ".jasper");
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private InputStream getStream(String fileName) throws IOException {
|
||||||
|
File initialFile = new File(fileName);
|
||||||
|
InputStream stream = new FileInputStream(initialFile);
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package io.gmss.infocad.controllers.decoupage;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.decoupage.Arrondissement;
|
||||||
|
import io.gmss.infocad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.infocad.interfaces.decoupage.ArrondissementService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/arrondissement", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class ArrondissementController {
|
||||||
|
|
||||||
|
private final ArrondissementService arrondissementService;
|
||||||
|
|
||||||
|
public ArrondissementController(ArrondissementService arrondissementService) {
|
||||||
|
this.arrondissementService = arrondissementService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createArrondissement(@RequestBody @Valid @Validated Arrondissement arrondissement) {
|
||||||
|
try{
|
||||||
|
arrondissement = arrondissementService.createArrondissement(arrondissement);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, arrondissement, "Arrondissement créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateArrondissement(@PathVariable Long id, @RequestBody Arrondissement arrondissement) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, arrondissementService.updateArrondissement(id, arrondissement), "Arrondissement mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteArrondissement(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
arrondissementService.deleteArrondissement(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Arrondissement supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllArrondissementList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, arrondissementService.getArrondissementList(), "Liste des arrondissements chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllArrondissementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, arrondissementService.getArrondissementList(pageable), "Liste des arrondissements chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, arrondissementService.getArrondissementById(id), "Arrondissement trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/commune/{communeId}")
|
||||||
|
public ResponseEntity<?> getArrondissementByCommune(@PathVariable Long communeId) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, arrondissementService.getArrondissementByComune(communeId), "Liste des arrondissements par commune chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (NotFoundException e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package io.gmss.infocad.controllers.decoupage;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.decoupage.Commune;
|
||||||
|
import io.gmss.infocad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.infocad.interfaces.decoupage.CommuneService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/commune", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class CommuneController {
|
||||||
|
|
||||||
|
private final CommuneService communeService;
|
||||||
|
|
||||||
|
public CommuneController(CommuneService communeService) {
|
||||||
|
this.communeService = communeService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createCommune(@RequestBody @Valid @Validated Commune commune) {
|
||||||
|
try{
|
||||||
|
commune = communeService.createCommune(commune);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commune, "Commune créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateCommune(@PathVariable Long id, @RequestBody Commune commune) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, communeService.updateCommune(id, commune), "Commune mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteCommuner(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
communeService.deleteCommune(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Commune supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllCommuneList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, communeService.getCommuneList(), "Liste des communes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllCommunePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, communeService.getCommuneList(pageable), "Liste des communes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getCommuneById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, communeService.getCommuneById(id), "Commune trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/departement/{departementId}")
|
||||||
|
public ResponseEntity<?> getCommuneByDepartement(@PathVariable Long departementId) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, communeService.getCommunesByDepartement(departementId), "Liste des communes par département chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (NotFoundException e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.decoupage;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.decoupage.Departement;
|
||||||
|
import io.gmss.infocad.interfaces.decoupage.DepartementService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/departement", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class DepartementController {
|
||||||
|
|
||||||
|
private final DepartementService departementService;
|
||||||
|
|
||||||
|
public DepartementController(DepartementService departementService) {
|
||||||
|
this.departementService = departementService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createDepartement(@RequestBody @Valid @Validated Departement departement) {
|
||||||
|
try{
|
||||||
|
departement = departementService.createDepartement(departement);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, departement, "Departement créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateDepartement(@PathVariable Long id, @RequestBody Departement departement) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, departementService.updateDepartement(id, departement), "Département mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteDepartementr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
departementService.deleteDepartement(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Département supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllDepartementList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, departementService.getDepartementList(), "Liste des département chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllDepartementPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, departementService.getDepartementList(pageable), "Liste des département chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getDepartementById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, departementService.getDepartementById(id), "Département trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.decoupage;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.decoupage.Nationalite;
|
||||||
|
import io.gmss.infocad.interfaces.decoupage.NationaliteService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/nationalite", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class NationaliteController {
|
||||||
|
|
||||||
|
private final NationaliteService nationaliteService;
|
||||||
|
|
||||||
|
public NationaliteController(NationaliteService nationaliteService) {
|
||||||
|
this.nationaliteService = nationaliteService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createNationalite(@RequestBody @Valid @Validated Nationalite nationalite) {
|
||||||
|
try{
|
||||||
|
nationalite = nationaliteService.createNationalite(nationalite);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, nationalite, "Nationalite créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateNationalite(@PathVariable Long id, @RequestBody Nationalite nationalite) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, nationaliteService.updateNationalite(id, nationalite), "Nationalités mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteNationaliter(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
nationaliteService.deleteNationalite(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Nationalités supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllNationaliteList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, nationaliteService.getNationaliteList(), "Liste des nationalités chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllNationalitePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, nationaliteService.getNationaliteList(pageable), "Liste des nationalités chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getNationaliteById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, nationaliteService.getNationaliteById(id), "Nationalités trouvées avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package io.gmss.infocad.controllers.decoupage;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.decoupage.Quartier;
|
||||||
|
import io.gmss.infocad.exceptions.NotFoundException;
|
||||||
|
import io.gmss.infocad.interfaces.decoupage.QuartierService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/quartier", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class QuartierController {
|
||||||
|
|
||||||
|
private final QuartierService quartierService;
|
||||||
|
|
||||||
|
public QuartierController(QuartierService quartierService) {
|
||||||
|
this.quartierService = quartierService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createQuartier(@RequestBody @Valid @Validated Quartier quartier) {
|
||||||
|
try{
|
||||||
|
quartier = quartierService.createQuartier(quartier);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, quartier, "Quartier créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateQuartier(@PathVariable Long id, @RequestBody Quartier quartier) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, quartierService.updateQuartier(id, quartier), "Quartier mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteQuartier(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
quartierService.deleteQuartier(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Quartier supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllQuartierList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, quartierService.getQuartierList(), "Liste des quartiers chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllQuartierPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, quartierService.getQuartierList(pageable), "Liste des quartiers chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getQuartierById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, quartierService.getQuartierById(id), "Quartier trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/arrondissement/{arrondissementId}")
|
||||||
|
public ResponseEntity<?> getQuartierByArrondissement(@PathVariable Long arrondissementId) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, quartierService.getQuartierByArrondissement(arrondissementId), "Liste des quartiers par commune chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (NotFoundException e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.metier;
|
||||||
|
|
||||||
|
import io.gmss.infocad.interfaces.infocad.metier.ActeurConcerneService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/acteur-concerne", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class ActeurConcerneController {
|
||||||
|
|
||||||
|
private final ActeurConcerneService acteurConcerneService;
|
||||||
|
|
||||||
|
public ActeurConcerneController(ActeurConcerneService acteurConcerneService) {
|
||||||
|
this.acteurConcerneService = acteurConcerneService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getArrondissementById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, acteurConcerneService.getActeurConcerneById(id).get(), "Arrondissement trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.metier;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Bloc;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.metier.BlocService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.security.CurrentUser;
|
||||||
|
import io.gmss.infocad.security.UserPrincipal;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/bloc", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class BlocController {
|
||||||
|
|
||||||
|
private final BlocService blocService;
|
||||||
|
|
||||||
|
public BlocController(BlocService blocService) {
|
||||||
|
this.blocService = blocService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createBloc(@RequestBody @Valid @Validated Bloc bloc, @CurrentUser UserPrincipal userPrincipal) {
|
||||||
|
try{
|
||||||
|
bloc = blocService.createBloc(bloc);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, bloc, "Bloc créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateBloc(@PathVariable Long id, @RequestBody Bloc bloc) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, blocService.updateBloc(id, bloc), "Bloc mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteBlocr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
blocService.deleteBloc(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Bloc supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllBlocList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, blocService.getBlocList(), "Liste des blocs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list-by-arrondissement")
|
||||||
|
public ResponseEntity<?> getAllBlocListByArrondissement(@RequestParam Long idArrondissement) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, blocService.getBlocsByArrondissement(idArrondissement), "Liste des blocs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list-by-structure")
|
||||||
|
public ResponseEntity<?> getAllBlocListByStructure(@RequestParam Long idStructure) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, blocService.getBlocsByStructure(idStructure), "Liste des blocs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllBlocPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, blocService.getBlocList(pageable), "Liste des blocs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getBlocById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, blocService.getBlocById(id), "Bloc trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.metier;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Commentaire;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.metier.CommentaireService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.paylaods.request.CommentaireRequest;
|
||||||
|
import io.gmss.infocad.paylaods.request.SyncCommentaireRequest;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/commentaire", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class CommentaireController {
|
||||||
|
|
||||||
|
private final CommentaireService commentaireService;
|
||||||
|
|
||||||
|
public CommentaireController(CommentaireService commentaireService) {
|
||||||
|
this.commentaireService = commentaireService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createcommentaire(@RequestBody @Valid @Validated Commentaire commentaire) {
|
||||||
|
try{
|
||||||
|
commentaire.setDateCommentaire(LocalDateTime.now());
|
||||||
|
commentaire = commentaireService.createCommentaire(commentaire);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaire, "Commentaire créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updatecommentaire(@PathVariable Long id, @RequestBody Commentaire commentaire) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.updateCommentaire(id, commentaire), "commentaire mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deletecommentaire(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
commentaireService.deleteCommentaire(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Commentaire supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllcommentaireList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentaireList(), "Liste des commentaires chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getcommentaireById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentaireById(id), "commentaire trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/nup/{nup}")
|
||||||
|
public ResponseEntity<?> getcommentaireByNup(@PathVariable String nup) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentaireByNup(nup), "commentaire trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/enquete")
|
||||||
|
public ResponseEntity<?> getcommentaireByEnquete(@RequestBody Commentaire commentaire) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentairesByEnqueteAndTerminal(commentaire.getIdEnquete(), commentaire.getTerminalId()), "Liste des commentaires chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/enquete-and-state")
|
||||||
|
@ApiOperation(value = "Cette ressource permet d'avoir la liste de tous les commentaires d'une enquête avec le statut (lu ou non lu). Les champs a renseigner pour le payload sont idEnquete et lu")
|
||||||
|
public ResponseEntity<?> getcommentaireByEnqueteAndStatut(@RequestBody Commentaire commentaire) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentairesByEnqueteAndLu(commentaire.getIdEnquete(), commentaire.isLu()), "Liste des commentaires chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/all-by-params")
|
||||||
|
@ApiOperation(value = "Cette ressource permet d'avoir 4 résultats différents. \n 1 - Liste des commentaires non lus provenant du Web. \n 2 - Liste des commentaires lus provenant du Web \n 3 - Liste des commentaires non lus provenant du mobile. \n 4 - Liste des commentaires lus provenant du mobile. \n A savoir : Les variables Origine et lu sont à varier pour avoir le résultat")
|
||||||
|
public ResponseEntity<?> getcommentaireByParams(@RequestBody CommentaireRequest commentaireRequest) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentairesByOrigineAndStateReadAndTerminalId(commentaireRequest.getOrigine(), commentaireRequest.isLu(), commentaireRequest.getTerminalId()), "Liste des commentaires chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("synchronise/from-mobile")
|
||||||
|
@ApiOperation(value = "Cette ressource permet de synchroniser tous les commentaires effectués sur le mobile vers le backend.")
|
||||||
|
public ResponseEntity<?> synchroniseCommentairesFromMobile(@RequestBody List<Commentaire> commentaires) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.saveAllCommentairesFromMobile(commentaires), "Liste des commentaires synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("synchronise/from-web")
|
||||||
|
@ApiOperation(value = "Cette ressource permet d'avoir 4 résultats différents. \n 1 - Liste des commentaires non synchronisés provenant du Web. \n 2 - Liste des commentaires synchronisés provenant du Web \n 3 - Liste des commentaires non synchronisés provenant du mobile. \n 4 - Liste des commentaires synchronisés provenant du mobile. \n A savoir : Les variables Origine et Synchronise sont à varier pour avoir le résultat")
|
||||||
|
public ResponseEntity<?> synchroniseCommentairesFromWeb(@RequestBody CommentaireRequest commentaireRequest) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.getCommentairesByOrigineAndStateSynchronizedAndTerminalId(commentaireRequest.getOrigine(), commentaireRequest.isSynchronise(), commentaireRequest.getTerminalId()), "Liste des commentaires chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("synchronise/notify-done-from-mobile")
|
||||||
|
@ApiOperation(value = "Cette ressource permet matérialiser coté backend les commentaires du WEB déjà synchronisé avec le MOBILE pour que les prochaines extractions ne prennent pas en compte cela. ")
|
||||||
|
public ResponseEntity<?> notifyDoneSynchronizedFromMobile(@RequestBody List<SyncCommentaireRequest> syncCommentaireRequests) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, commentaireService.notifySynchronizedDoneFromMobile(syncCommentaireRequests), "Synchronisation terminée."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,190 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.metier;
|
||||||
|
|
||||||
|
import io.gmss.infocad.interfaces.infocad.metier.EnqueteService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.paylaods.request.EnquetePayLoad;
|
||||||
|
import io.gmss.infocad.paylaods.request.EnqueteTraitementPayLoad;
|
||||||
|
import io.gmss.infocad.paylaods.request.FiltreEnquetePayLoad;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/enquete", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class EnqueteController {
|
||||||
|
|
||||||
|
private final EnqueteService enqueteService ;
|
||||||
|
|
||||||
|
public EnqueteController(EnqueteService enqueteService) {
|
||||||
|
this.enqueteService = enqueteService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createStructure(@RequestBody @Valid @Validated EnquetePayLoad enquetePayLoad) {
|
||||||
|
// try{
|
||||||
|
// enquete = enqueteService.createEnquete(enquete);
|
||||||
|
// return new ResponseEntity<>(
|
||||||
|
// new ApiResponse<>(true, structure, "Structure créé avec succès."),
|
||||||
|
// HttpStatus.OK
|
||||||
|
// );
|
||||||
|
// }catch (Exception e){
|
||||||
|
// return new ResponseEntity<>(
|
||||||
|
// new ApiResponse<>(false, e.getMessage()),
|
||||||
|
// HttpStatus.OK
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/validation")
|
||||||
|
public ResponseEntity<?> validerEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.validerEnquete(enqueteTraitementPayLoad), "Validation effectuée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false,"Impossible de valider l'enquête : "+e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/rejet")
|
||||||
|
public ResponseEntity<?> rejeterEnquete(@RequestBody EnqueteTraitementPayLoad enqueteTraitementPayLoad) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.rejeterEnquete(enqueteTraitementPayLoad), "Rejet effectuée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false,"Impossible de valider l'enquête : "+e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/validation-lot")
|
||||||
|
public ResponseEntity<?> validerEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.validerEnquete(enqueteTraitementPayLoads), "Validation effectuée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false,"Impossible de valider l'enquête : " + e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/rejet-lot")
|
||||||
|
public ResponseEntity<?> rejeterEnqueteParLot(@RequestBody List<EnqueteTraitementPayLoad> enqueteTraitementPayLoads) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.rejeterEnquete(enqueteTraitementPayLoads), "Rejet effectuée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false,"Impossible de valider l'enquête : "+e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all/decoupage-admin-for-enquete")
|
||||||
|
public ResponseEntity<?> getAllByEnqueteDecoupageAdmin() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getDecoupageAdminUserConnecterAndStat(), "Liste des enquetes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
enqueteService.deleteEnquete(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"enquete supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllStructureList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getEnqueteList(), "Liste des enquetes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all/com-arrond-bloc")
|
||||||
|
public ResponseEntity<?> getAllByCommuneArrondBloc() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getEnqueteCommuneArrondBloc(), "Liste des enquetes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/all/com-arrond-bloc/filtre")
|
||||||
|
public ResponseEntity<?> getAllByCommuneArrondBlocFiltre(@RequestBody FiltreEnquetePayLoad filtreEnquetePayLoad) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getEnqueteCommuneArrondBlocFiltre(filtreEnquetePayLoad), "Liste des enquetes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllEnquetePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getEnqueteList(pageable), "Liste des enquetes chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/fiche/id/{id}")
|
||||||
|
public ResponseEntity<?> getFicheEnqueteById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getFicheEnquete(id), "enquete trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getEnqueteById(id), "enquete trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/traiter-non-synch-to-mobile/{terminalId}")
|
||||||
|
public ResponseEntity<?> getEnqueteValideNonSynch(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, enqueteService.getEnqueteValideNonSynch(terminalId), "Liste des enquetes traitées non synchronisées sur le termianl."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.metier;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Tpe;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.metier.TpeService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/tpe", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TpeController {
|
||||||
|
|
||||||
|
private final TpeService tpeService;
|
||||||
|
|
||||||
|
public TpeController(TpeService tpeService) {
|
||||||
|
this.tpeService = tpeService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTpe(@RequestBody @Valid @Validated Tpe tpe) {
|
||||||
|
try{
|
||||||
|
tpe = tpeService.createTpe(tpe);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpe, "Tpe créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTpe(@PathVariable Long id, @RequestBody Tpe tpe) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.updateTpe(id, tpe), "Tpe mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTper(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
tpeService.deleteTpe(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Tpe supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTpeList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.getTpeList(), "Liste des tpe chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-by-model/{model}")
|
||||||
|
public ResponseEntity<?> getAllTpeListByModel(@PathVariable String model) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.getTpeListByModel(model), "Liste des tpe chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-by-userId/{userId}")
|
||||||
|
public ResponseEntity<?> getAllTpeListByUserId(@PathVariable Long userId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.getTpeListByUserId(userId), "Liste des tpe de l'utilisateurs."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.getTpeList(pageable), "Liste des tpe chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTpeById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.getTpeById(id), "Tpe trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/identifier/{identifier}")
|
||||||
|
public ResponseEntity<?> getTpeByIdentifier(@PathVariable String identifier) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, tpeService.getTepByIdentifier(identifier), "Tpe trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,232 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.metier;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Upload;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.repositories.infocad.metier.UploadRepository;
|
||||||
|
import io.gmss.infocad.service.FileStorageService;
|
||||||
|
import io.gmss.infocad.service.StringManager;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.client.HttpClientErrorException;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author AKAKPO Aurince
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/api/upload", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
@Api(value = "Uploads controllers", description = "API for accessing to uploads files details.", tags = {"Uploads"})
|
||||||
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||||
|
@Data
|
||||||
|
public class UploadController {
|
||||||
|
|
||||||
|
boolean headIsValid=false;
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(UploadController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UploadRepository uploadRepository;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FileStorageService fileStorageService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StringManager stringManager;
|
||||||
|
|
||||||
|
// @Autowired
|
||||||
|
// private ActeurRepository proprietaireRepository;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private int firstLineColumnNumber = 0;
|
||||||
|
private String fileHeader;
|
||||||
|
private String fileHeaderType;
|
||||||
|
private int anneeFiscale;
|
||||||
|
private int indiceOfFile = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private SimpleDateFormat sdf = new SimpleDateFormat("YYYYMMDD");
|
||||||
|
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("YYYYMMDD");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
@ApiOperation(value = "List of uploads files.")
|
||||||
|
public ResponseEntity<?> all() {
|
||||||
|
try {
|
||||||
|
if (uploadRepository.findAll().isEmpty()) {
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true, uploadRepository.findAll(), "Empty list. No values present."), HttpStatus.OK);
|
||||||
|
} else {
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true, uploadRepository.findAll(), "All uploads files founded."), 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/all/proprietaireid/{proprietaireid}")
|
||||||
|
// @ApiOperation(value = "List des fichiers d'un proprietaire.")
|
||||||
|
// public ResponseEntity<?> allByActeurId(@PathVariable Long proprietaireid) {
|
||||||
|
// try {
|
||||||
|
// List<Upload> uploads=uploadRepository.findAllByActeur_Id(proprietaireid);
|
||||||
|
// if (uploads.isEmpty()) {
|
||||||
|
// return new ResponseEntity<>(new ApiResponse(true, "Empty list. No values present.", HttpStatus.NOT_FOUND, uploads), HttpStatus.OK);
|
||||||
|
// } else {
|
||||||
|
// return new ResponseEntity<>(new ApiResponse(true, "All uploads files founded.", HttpStatus.OK, uploadRepository.findAll()), HttpStatus.OK);
|
||||||
|
// }
|
||||||
|
// } catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
// return new ResponseEntity<>(new ApiResponse(false, "Method POST/GET is required.", HttpStatus.METHOD_NOT_ALLOWED, null), HttpStatus.OK);
|
||||||
|
// } catch (NullPointerException e) {
|
||||||
|
// logger.error(e.getLocalizedMessage());
|
||||||
|
// return new ResponseEntity<>(new ApiResponse(false, "Null value has been detected {" + e.getMessage() + "}.", HttpStatus.BAD_REQUEST, null), HttpStatus.OK);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// logger.error(e.getLocalizedMessage());
|
||||||
|
// return new ResponseEntity<>(new ApiResponse(false, "An error has been occur and the content is {" + e.getMessage() + "}.", HttpStatus.INTERNAL_SERVER_ERROR, null), HttpStatus.OK);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
@ApiOperation(value = "Get one upload by his id.")
|
||||||
|
public ResponseEntity<?> one(@PathVariable Long id) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (uploadRepository.findById(id).isPresent()) {
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true, uploadRepository.getOne(id), "File with id {" + id + "} is found."), HttpStatus.OK);
|
||||||
|
} else {
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true, null,"The upload with id {" + id + "} you request for is not found."), 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param fileName
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "This resource is used to download one file from server.")
|
||||||
|
@GetMapping("/downloadFile/{fileName:.+}")
|
||||||
|
public ResponseEntity<Resource> downloadFile(@PathVariable String fileName, HttpServletRequest request) {
|
||||||
|
// Load file as Resource
|
||||||
|
Resource resource = fileStorageService.loadFileAsResource(fileName);
|
||||||
|
|
||||||
|
// Try to determine file's content type
|
||||||
|
String contentType = null;
|
||||||
|
try {
|
||||||
|
contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());
|
||||||
|
} catch (IOException ex) {
|
||||||
|
logger.info("Could not determine file type.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to the default content type if type could not be determined
|
||||||
|
if (contentType == null) {
|
||||||
|
contentType = "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.ok()
|
||||||
|
.contentType(MediaType.parseMediaType(contentType))
|
||||||
|
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
|
||||||
|
.body(resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperation(value = "Add one upload.")
|
||||||
|
public ResponseEntity<?> save(@RequestPart(required = true) MultipartFile file , @RequestParam String reference,@RequestParam String description /*, @RequestParam Long idTypeUpload*/) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
Upload upload = new Upload();
|
||||||
|
// Optional<TypeUpload> optionalTypeUpload=typeUploadRepository.findById(1L);
|
||||||
|
// if(optionalTypeUpload.isPresent()){
|
||||||
|
// upload.setTypeUpload(optionalTypeUpload.get());
|
||||||
|
// }else {
|
||||||
|
// return new ResponseEntity<>(new ApiResponse(false, "Ce type de document n'est pas autorisé", HttpStatus.BAD_REQUEST, null), HttpStatus.OK);
|
||||||
|
// }
|
||||||
|
// Optional<Acteur> optionalActeur = proprietaireRepository.findById(idActeur);
|
||||||
|
// if (optionalActeur.isPresent()) {
|
||||||
|
// upload.setActeur(optionalActeur.get());
|
||||||
|
// }
|
||||||
|
String fileName = fileStorageService.storeFile(file);
|
||||||
|
upload.setFileName(fileName);
|
||||||
|
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) {
|
||||||
|
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/{id}")
|
||||||
|
@ApiOperation(value = "Delete one upload.")
|
||||||
|
public ResponseEntity<?> delete(@PathVariable Long id) {
|
||||||
|
try {
|
||||||
|
if (id != null || uploadRepository.findById(id).isPresent()) {
|
||||||
|
String name = uploadRepository.getOne(id).getFileName();
|
||||||
|
fileStorageService.deleteFile(name);
|
||||||
|
uploadRepository.deleteById(id);
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true,null, "File with name {" + name + "} has been deleted successfully."), HttpStatus.OK);
|
||||||
|
} else {
|
||||||
|
return new ResponseEntity<>(new ApiResponse(true,null, "The upload specified in your request body is not found."), 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.ModeAcquisition;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.ModeAcquisitionService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/mode-acquisition", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class ModeAcquisitionController {
|
||||||
|
|
||||||
|
private final ModeAcquisitionService modeAcquisitionService;
|
||||||
|
|
||||||
|
public ModeAcquisitionController(ModeAcquisitionService modeAcquisitionService) {
|
||||||
|
this.modeAcquisitionService = modeAcquisitionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createModeAcquisition(@RequestBody @Valid @Validated ModeAcquisition modeAcquisition) {
|
||||||
|
try{
|
||||||
|
modeAcquisition = modeAcquisitionService.createModeAcquisition(modeAcquisition);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, modeAcquisition, "Mode acquisition créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateModeAcquisition(@PathVariable Long id, @RequestBody ModeAcquisition modeAcquisition) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, modeAcquisitionService.updateModeAcquisition(id, modeAcquisition), "Mode d'acquisition mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteModeAcquisitionr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
modeAcquisitionService.deleteModeAcquisition(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Mode d'acquisition supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllModeAcquisitionList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, modeAcquisitionService.getModeAcquisitionList(), "Liste des modes d'acquisitions chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllModeAcquisitionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, modeAcquisitionService.getModeAcquisitionList(pageable), "Liste des modes d'acquisitions chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getModeAcquisitionById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, modeAcquisitionService.getModeAcquisitionById(id), "Mode d'acquisition trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.NatureDomaine;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.NatureDomaineService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/nature-domaine", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class NatureDomaineController {
|
||||||
|
|
||||||
|
private final NatureDomaineService natureDomaineService;
|
||||||
|
|
||||||
|
public NatureDomaineController(NatureDomaineService natureDomaineService) {
|
||||||
|
this.natureDomaineService = natureDomaineService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createNatureDomaine(@RequestBody @Valid @Validated NatureDomaine natureDomaine) {
|
||||||
|
try{
|
||||||
|
natureDomaine = natureDomaineService.createNatureDomaine(natureDomaine);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, natureDomaine, "Nature Domaine créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateNatureDomaine(@PathVariable Long id, @RequestBody NatureDomaine natureDomaine) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, natureDomaineService.updateNatureDomaine(id, natureDomaine), "Nature Domaine mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteNatureDomainer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
natureDomaineService.deleteNatureDomaine(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Nature Domaine supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllNatureDomaineList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, natureDomaineService.getNatureDomaineList(), "Liste des natures de domaine chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllNatureDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, natureDomaineService.getNatureDomaineList(pageable), "Liste des natures de domaine chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getNatureDomaineById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, natureDomaineService.getNatureDomaineById(id), "Nature Domaine trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.PositionRepresentation;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.PositionRepresentationService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/position-representation", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class PositionRepresentationController {
|
||||||
|
|
||||||
|
private final PositionRepresentationService positionRepresentationService;
|
||||||
|
|
||||||
|
public PositionRepresentationController(PositionRepresentationService positionRepresentationService) {
|
||||||
|
this.positionRepresentationService = positionRepresentationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createPositionRepresentation(@RequestBody @Valid @Validated PositionRepresentation positionRepresentation) {
|
||||||
|
try{
|
||||||
|
positionRepresentation = positionRepresentationService.createPositionRepresentation(positionRepresentation);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, positionRepresentation, "Position de representation créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updatePositionRepresentation(@PathVariable Long id, @RequestBody PositionRepresentation positionRepresentation) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, positionRepresentationService.updatePositionRepresentation(id, positionRepresentation), "Position de representation mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deletePositionRepresentation(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
positionRepresentationService.deletePositionRepresentation(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Position de representation supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllPositionRepresentationList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, positionRepresentationService.getPositionRepresentationList(), "Liste des positions de representation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllPositionRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, positionRepresentationService.getPositionRepresentationList(pageable), "Liste des positions de representation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getPositionRepresentationById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, positionRepresentationService.getPositionRepresentationById(id), "Position de representation trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Profession;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.ProfessionService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/profession", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class ProfessionController {
|
||||||
|
|
||||||
|
private final ProfessionService professionService;
|
||||||
|
|
||||||
|
public ProfessionController(ProfessionService professionService) {
|
||||||
|
this.professionService = professionService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createProfession(@RequestBody @Valid @Validated Profession profession) {
|
||||||
|
try{
|
||||||
|
profession = professionService.createProfession(profession);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, profession, "Profession créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateProfession(@PathVariable Long id, @RequestBody Profession profession) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, professionService.updateProfession(id, profession), "Profession mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteProfessionr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
professionService.deleteProfession(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Profession supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllProfessionList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, professionService.getProfessionList(), "Liste des professions chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllProfessionPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, professionService.getProfessionList(pageable), "Liste des professions chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getProfessionById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, professionService.getProfessionById(id), "Profession trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.SituationGeographique;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.SituationGeographiqueService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/situation-geographique", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class SituationGeographiqueController {
|
||||||
|
|
||||||
|
private final SituationGeographiqueService situationGeographiqueService;
|
||||||
|
|
||||||
|
public SituationGeographiqueController(SituationGeographiqueService situationGeographiqueService) {
|
||||||
|
this.situationGeographiqueService = situationGeographiqueService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createSituationGeographique(@RequestBody @Valid @Validated SituationGeographique situationGeographique) {
|
||||||
|
try{
|
||||||
|
situationGeographique = situationGeographiqueService.createSituationGeographique(situationGeographique);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationGeographique, "Situation géographique créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateSituationGeographique(@PathVariable Long id, @RequestBody SituationGeographique situationGeographique) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationGeographiqueService.updateSituationGeographique(id, situationGeographique), "Situation géographique mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteSituationGeographiquer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
situationGeographiqueService.deleteSituationGeographique(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Situation géographique supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllSituationGeographiqueList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationGeographiqueService.getSituationGeographiqueList(), "Liste des situations géographiques chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllSituationGeographiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationGeographiqueService.getSituationGeographiqueList(pageable), "Liste des situations géographiques chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getSituationGeographiqueById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationGeographiqueService.getSituationGeographiqueById(id), "Situation géographique trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.SituationMatrimoniale;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.SituationMatrimonialeService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/situation-matrimoniale", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class SituationMatrimonialeController {
|
||||||
|
|
||||||
|
private final SituationMatrimonialeService situationMatrimonialeService;
|
||||||
|
|
||||||
|
public SituationMatrimonialeController(SituationMatrimonialeService situationMatrimonialeService) {
|
||||||
|
this.situationMatrimonialeService = situationMatrimonialeService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createSituationMatrimoniale(@RequestBody @Valid @Validated SituationMatrimoniale situationMatrimoniale) {
|
||||||
|
try{
|
||||||
|
situationMatrimoniale = situationMatrimonialeService.createSituationMatrimoniale(situationMatrimoniale);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationMatrimoniale, "Situation matrimoniale créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateSituationMatrimoniale(@PathVariable Long id, @RequestBody SituationMatrimoniale situationMatrimoniale) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationMatrimonialeService.updateSituationMatrimoniale(id, situationMatrimoniale), "Situation matrimoniale mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteSituationMatrimonialer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
situationMatrimonialeService.deleteSituationMatrimoniale(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Situation matrimoniale supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllSituationMatrimonialeList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationMatrimonialeService.getSituationMatrimonialeList(), "Liste des situations matrimoniales chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllSituationMatrimonialePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationMatrimonialeService.getSituationMatrimonialeList(pageable), "Liste des situations matrimoniales chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getSituationMatrimonialeById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, situationMatrimonialeService.getSituationMatrimonialeById(id), "Situation matrimoniale trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.SourceDroit;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.SourceDroitService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/source-droit", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class SourceDroitController {
|
||||||
|
|
||||||
|
private final SourceDroitService sourceDroitService;
|
||||||
|
|
||||||
|
public SourceDroitController(SourceDroitService sourceDroitService) {
|
||||||
|
this.sourceDroitService = sourceDroitService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createSourceDroit(@RequestBody @Valid @Validated SourceDroit sourceDroit) {
|
||||||
|
try{
|
||||||
|
sourceDroit = sourceDroitService.createSourceDroit(sourceDroit);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, sourceDroit, "Source de droit créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateSourceDroit(@PathVariable Long id, @RequestBody SourceDroit sourceDroit) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, sourceDroitService.updateSourceDroit(id, sourceDroit), "Source de droit mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteSourceDroitr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
sourceDroitService.deleteSourceDroit(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Source de droit supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllSourceDroitList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, sourceDroitService.getSourceDroitList(), "Liste des sources de droit chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllSourceDroitPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, sourceDroitService.getSourceDroitList(pageable), "Liste des sources de droit chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getSourceDroitById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, sourceDroitService.getSourceDroitById(id), "Source de droit trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Structure;
|
||||||
|
import io.gmss.infocad.interfaces.decoupage.ArrondissementService;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.StructureService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/structure", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class StructureController {
|
||||||
|
|
||||||
|
private final StructureService structureService;
|
||||||
|
private final ArrondissementService arrondissementService;
|
||||||
|
|
||||||
|
public StructureController(StructureService structureService, ArrondissementService arrondissementService) {
|
||||||
|
this.structureService = structureService;
|
||||||
|
this.arrondissementService = arrondissementService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createStructure(@RequestBody @Valid @Validated Structure structure) {
|
||||||
|
try{
|
||||||
|
structure = structureService.createStructure(structure);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, structure, "Structure créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateStructure(@PathVariable Long id, @RequestBody Structure structure) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, structureService.updateStructure(id, structure), "Structure mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteStructurer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
structureService.deleteStructure(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Structure supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllStructureList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, structureService.getStructureList(), "Liste des structures chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/all-by-arrondissement")
|
||||||
|
public ResponseEntity<?> getAllStructureListByArrondissement(@RequestParam Long arrondissementId) {
|
||||||
|
|
||||||
|
if(arrondissementService.getArrondissementById(arrondissementId).isPresent()){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, structureService.getStructuresByArrondissement(arrondissementId), "Liste des structures chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false,"Impossible de trouver l'arrondissement spécifiée."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllStructurePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, structureService.getStructureList(pageable), "Liste des structures chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getStructureById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, structureService.getStructureById(id), "Structure trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypeContestation;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.TypeContestationService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/type-contestation", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TypeContestationController {
|
||||||
|
|
||||||
|
private final TypeContestationService typeContestationService;
|
||||||
|
|
||||||
|
public TypeContestationController(TypeContestationService typeContestationService) {
|
||||||
|
this.typeContestationService = typeContestationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTypeContestation(@RequestBody @Valid @Validated TypeContestation typeContestation) {
|
||||||
|
try{
|
||||||
|
typeContestation = typeContestationService.createTypeContestation(typeContestation);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeContestation, "Type de contestation créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTypeContestation(@PathVariable Long id, @RequestBody TypeContestation typeContestation) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeContestationService.updateTypeContestation(id, typeContestation), "Type de contestation mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTypeContestationr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
typeContestationService.deleteTypeContestation(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Type de contestation supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTypeContestationList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeContestationService.getTypeContestationList(), "Liste des types de contestation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTypeContestationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeContestationService.getTypeContestationList(pageable), "Liste des types de contestation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTypeContestationById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeContestationService.getTypeContestationById(id), "Type de contestation trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypeDomaine;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.TypeDomaineService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/type-domaine", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TypeDomaineController {
|
||||||
|
|
||||||
|
private final TypeDomaineService typeDomaineService;
|
||||||
|
|
||||||
|
public TypeDomaineController(TypeDomaineService typeDomaineService) {
|
||||||
|
this.typeDomaineService = typeDomaineService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTypeDomaine(@RequestBody @Valid @Validated TypeDomaine typeDomaine) {
|
||||||
|
try{
|
||||||
|
typeDomaine = typeDomaineService.createTypeDomaine(typeDomaine);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeDomaine, "Type de domaine créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTypeDomaine(@PathVariable Long id, @RequestBody TypeDomaine typeDomaine) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeDomaineService.updateTypeDomaine(id, typeDomaine), "Type de domaine mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTypeDomainer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
typeDomaineService.deleteTypeDomaine(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Type de domaine supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTypeDomaineList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeDomaineService.getTypeDomaineList(), "Liste des types de domaine chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTypeDomainePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeDomaineService.getTypeDomaineList(pageable), "Liste des types de domaine chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTypeDomaineById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeDomaineService.getTypeDomaineById(id), "Type de domaine trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypePersonne;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.TypePersonneService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/type-personne", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TypePersonneController {
|
||||||
|
|
||||||
|
private final TypePersonneService typePersonneService;
|
||||||
|
|
||||||
|
public TypePersonneController(TypePersonneService typePersonneService) {
|
||||||
|
this.typePersonneService = typePersonneService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTypePersonne(@RequestBody @Valid @Validated TypePersonne typePersonne) {
|
||||||
|
try{
|
||||||
|
typePersonne = typePersonneService.createTypePersonne(typePersonne);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePersonne, "Type de personne créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTypePersonne(@PathVariable Long id, @RequestBody TypePersonne typePersonne) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePersonneService.updateTypePersonne(id, typePersonne), "Type de personne mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTypePersonner(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
typePersonneService.deleteTypePersonne(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Type de personne supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTypePersonneList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePersonneService.getTypePersonneList(), "Liste des types de personne chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTypePersonnePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePersonneService.getTypePersonneList(pageable), "Liste des types de personne chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTypePersonneById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePersonneService.getTypePersonneById(id), "Type de personne trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypePiece;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.TypePieceService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/type-piece", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TypePieceController {
|
||||||
|
|
||||||
|
private final TypePieceService typePieceService;
|
||||||
|
|
||||||
|
public TypePieceController(TypePieceService typePieceService) {
|
||||||
|
this.typePieceService = typePieceService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTypePiece(@RequestBody @Valid @Validated TypePiece typePiece) {
|
||||||
|
try{
|
||||||
|
typePiece = typePieceService.createTypePiece(typePiece);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePiece, "Type de piece créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTypePiece(@PathVariable Long id, @RequestBody TypePiece typePiece) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePieceService.updateTypePiece(id, typePiece), "Type de piece mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTypePiecer(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
typePieceService.deleteTypePiece(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Type de piece supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTypePieceList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePieceService.getTypePieceList(), "Liste des types de piece chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTypePiecePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePieceService.getTypePieceList(pageable), "Liste des types de piece chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTypePieceById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typePieceService.getTypePieceById(id), "Type de piece trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.infocad.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypeRepresentation;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.TypeRepresentationService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/type-representation", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TypeRepresentationController {
|
||||||
|
|
||||||
|
private final TypeRepresentationService typeRepresentationService;
|
||||||
|
|
||||||
|
public TypeRepresentationController(TypeRepresentationService typeRepresentationService) {
|
||||||
|
this.typeRepresentationService = typeRepresentationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTypeRepresentation(@RequestBody @Valid @Validated TypeRepresentation typeRepresentation) {
|
||||||
|
try{
|
||||||
|
typeRepresentation = typeRepresentationService.createTypeRepresentation(typeRepresentation);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeRepresentation, "Type de representation créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTypeRepresentation(@PathVariable Long id, @RequestBody TypeRepresentation typeRepresentation) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeRepresentationService.updateTypeRepresentation(id, typeRepresentation), "Type de representation mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTypeRepresentationr(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
typeRepresentationService.deleteTypeRepresentation(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Type de representation supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTypeRepresentationList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeRepresentationService.getTypeRepresentationList(), "Liste des types de representation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTypeRepresentationPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeRepresentationService.getTypeRepresentationList(pageable), "Liste des types de representation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTypeRepresentationById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeRepresentationService.getTypeRepresentationById(id), "Type de representation trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package io.gmss.infocad.controllers.notification;
|
||||||
|
|
||||||
|
import io.gmss.infocad.interfaces.notification.EmailService;
|
||||||
|
import io.gmss.infocad.paylaods.EmailDetails;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/email", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class EmailController {
|
||||||
|
|
||||||
|
private final EmailService emailService;
|
||||||
|
|
||||||
|
public EmailController(EmailService emailService) {
|
||||||
|
this.emailService = emailService;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sending a simple Email
|
||||||
|
@PostMapping("/sendMail")
|
||||||
|
public String sendMail(@RequestBody EmailDetails details)
|
||||||
|
{
|
||||||
|
return emailService.sendSimpleMail(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sending email with attachment
|
||||||
|
@PostMapping("/sendMailWithAttachment")
|
||||||
|
public String sendMailWithAttachment(
|
||||||
|
@RequestBody EmailDetails details)
|
||||||
|
{
|
||||||
|
String status
|
||||||
|
= emailService.sendMailWithAttachment(details);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package io.gmss.infocad.controllers.report;
|
||||||
|
|
||||||
|
import io.gmss.infocad.enums.FormatRapport;
|
||||||
|
import io.gmss.infocad.paylaods.request.FiltreEnquetePayLoad;
|
||||||
|
import io.gmss.infocad.repositories.infocad.metier.BlocRepository;
|
||||||
|
import io.gmss.infocad.repositories.infocad.parametre.StructureRepository;
|
||||||
|
import io.gmss.infocad.service.ReportService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author AKAKPO Aurince
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "/api/rapport", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
@Api(value = "controleur rapport", description = "API d'edition des rapport.", tags = {"Rapports"})
|
||||||
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||||
|
public class ReportingController {
|
||||||
|
private final ReportService reportService;
|
||||||
|
private final BlocRepository blocRepository;
|
||||||
|
private final StructureRepository structureRepository;
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ReportingController.class);
|
||||||
|
|
||||||
|
public ReportingController(ReportService reportService, BlocRepository blocRepository, StructureRepository structureRepository) {
|
||||||
|
this.reportService = reportService;
|
||||||
|
this.blocRepository = blocRepository;
|
||||||
|
this.structureRepository = structureRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/structure/blocs/{formatRapport}/{structureId}")
|
||||||
|
@ApiOperation(value = "Liste des blos d'une structure.")
|
||||||
|
public void imprimerBlocsParStructure(HttpServletResponse response, @PathVariable FormatRapport formatRapport, @PathVariable Long structureId) {
|
||||||
|
try {
|
||||||
|
reportService.imprimerBlocsStructure(response,formatRapport,structureId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/bloc/enquetes/{formatRapport}/{blocId}")
|
||||||
|
@ApiOperation(value = "Liste des zones ou quartiers d'intervention d'une structure.")
|
||||||
|
public void imprimerEnqueteParBloc(HttpServletResponse response, @PathVariable FormatRapport formatRapport, @PathVariable Long blocId) {
|
||||||
|
try {
|
||||||
|
reportService.imprimerEnqueteParBloc(response,formatRapport,blocId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/filtre/enquetes/{formatRapport}")
|
||||||
|
@ApiOperation(value = "Liste des zones ou quartiers d'intervention d'une structure.")
|
||||||
|
public void imprimerEnqueteParFiltre(HttpServletResponse response, @RequestBody FiltreEnquetePayLoad filtreEnquetePayLoad, @PathVariable FormatRapport formatRapport) {
|
||||||
|
try {
|
||||||
|
reportService.imprimerEnqueteParFiltre(response,filtreEnquetePayLoad,formatRapport);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.rfu.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.rfu.parametre.Caracteristique;
|
||||||
|
import io.gmss.infocad.interfaces.rfu.parametre.CaracteristiqueService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/caracteristique", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class CaracteristiqueController {
|
||||||
|
|
||||||
|
private final CaracteristiqueService caracteristiqueService;
|
||||||
|
|
||||||
|
public CaracteristiqueController(CaracteristiqueService caracteristiqueService) {
|
||||||
|
this.caracteristiqueService = caracteristiqueService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createCaracteristique(@RequestBody @Valid @Validated Caracteristique caracteristique) {
|
||||||
|
try{
|
||||||
|
caracteristique = caracteristiqueService.createCaracteristique(caracteristique);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, caracteristique, "Caracteristique créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateCaracteristique(@PathVariable Long id, @RequestBody Caracteristique caracteristique) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, caracteristiqueService.updateCaracteristique(id, caracteristique), "Caracteristique mise à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteCaracteristique(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
caracteristiqueService.deleteCaracteristique(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Caracteristique supprimée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllCaracteristiqueList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, caracteristiqueService.getCaracteristiqueList(), "Liste des caractéristiques chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, caracteristiqueService.getCaracteristiqueList(pageable), "Liste des caractéristiques chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getCaracteristiqueById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, caracteristiqueService.getCaracteristiqueById(id), "Caracteristique trouvée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package io.gmss.infocad.controllers.rfu.parametre;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.rfu.parametre.TypeCaracteristique;
|
||||||
|
import io.gmss.infocad.interfaces.rfu.parametre.TypeCaracteristiqueService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/type-caracteristique", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class TypeCaracteristiqueController {
|
||||||
|
|
||||||
|
private final TypeCaracteristiqueService typeCaracteristiqueService;
|
||||||
|
|
||||||
|
public TypeCaracteristiqueController(TypeCaracteristiqueService typeCaracteristiqueService) {
|
||||||
|
this.typeCaracteristiqueService = typeCaracteristiqueService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createTypeCaracteristique(@RequestBody @Valid @Validated TypeCaracteristique typeCaracteristique) {
|
||||||
|
try{
|
||||||
|
typeCaracteristique = typeCaracteristiqueService.createTypeCaracteristique(typeCaracteristique);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeCaracteristique, "Type de caracteristique créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateTypeCaracteristique(@PathVariable Long id, @RequestBody TypeCaracteristique typeCaracteristique) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeCaracteristiqueService.updateTypeCaracteristique(id, typeCaracteristique), "Type caracteristique mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteTypeCaracteristique(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
typeCaracteristiqueService.deleteTypeCaracteristique(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Type caracteristique supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllTypeCaracteristiqueList() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeCaracteristiqueService.getTypeCaracteristiqueList(), "Liste des types caracteristiques chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllTypeCaracteristiquePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeCaracteristiqueService.getTypeCaracteristiqueList(pageable), "Liste des types caracteristiques chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getTypeCaracteristiqueById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, typeCaracteristiqueService.getTypeCaracteristiqueById(id), "Type caracteristique trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package io.gmss.infocad.controllers.statistique;
|
||||||
|
|
||||||
|
import io.gmss.infocad.interfaces.statistique.StatistiquesService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/statistique", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class StatistiqueController {
|
||||||
|
private final StatistiquesService statistiquesService ;
|
||||||
|
|
||||||
|
public StatistiqueController(StatistiquesService statistiquesService) {
|
||||||
|
this.statistiquesService = statistiquesService;
|
||||||
|
}
|
||||||
|
@GetMapping(path = "/user/enquete-par-statut")
|
||||||
|
public ResponseEntity<?> getStatistiquesParStatut() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, statistiquesService.getStatEnqueteParStatut(), "Statistique des enquêtes par statut."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/enquete-par-arrondissement/{commune_id}")
|
||||||
|
public ResponseEntity<?> getStatistiquesParArrondissement(@PathVariable Long commune_id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, statistiquesService.getStatEnqueteAdminDecoupage(commune_id), "Statistique des enquêtes par arrondissement."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/user/enquete-par-structure")
|
||||||
|
public ResponseEntity<?> getStatistiquesParStructure() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, statistiquesService.getStatEnqueteAdminStructure(), "Statistique des enquêtes par structure."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/user/enquete-par-bloc")
|
||||||
|
public ResponseEntity<?> getStatistiquesParBloc() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, statistiquesService.getStatBloc(), "Statistique des enquêtes par bloc."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package io.gmss.infocad.controllers.synchronisation;
|
||||||
|
|
||||||
|
import io.gmss.infocad.interfaces.synchronisation.RestaurationService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/restauration", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class RestaurationController {
|
||||||
|
public final RestaurationService restaurationService;
|
||||||
|
|
||||||
|
public RestaurationController(RestaurationService restaurationService) {
|
||||||
|
this.restaurationService = restaurationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/enquete/{terminalId}")
|
||||||
|
public ResponseEntity<?> getEnquetes(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getEnquete(terminalId), "liste des enquetes avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/acteur-concerne/{terminalId}")
|
||||||
|
public ResponseEntity<?> getActeurConcerne(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getActeurConcernes(terminalId), "liste des acteurs concernés avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/personne/{terminalId}") // ok
|
||||||
|
public ResponseEntity<?> getPersonnes(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getPersonne(terminalId), "liste des personnes avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/membre-groupe/{terminalId}")
|
||||||
|
public ResponseEntity<?> getMembrePersonnes(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getMembreGroupe(terminalId), "liste des membres groupe avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/parcelle/{terminalId}")
|
||||||
|
public ResponseEntity<?> getParcelle(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getParcelle(terminalId), "liste des parcelle avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/piece/{terminalId}")
|
||||||
|
public ResponseEntity<?> getPieces(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getPieces(terminalId), "liste des enquetes avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/upload/{terminalId}")
|
||||||
|
public ResponseEntity<?> getUpload(@PathVariable Long terminalId) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getUpload(terminalId), "liste des enquetes avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(path = "/current-user-tpes")
|
||||||
|
public ResponseEntity<?> getCurrentUserTpe() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, restaurationService.getTpeListByCurrentUser(), "liste des enquetes avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,132 @@
|
|||||||
|
package io.gmss.infocad.controllers.synchronisation;
|
||||||
|
|
||||||
|
import io.gmss.infocad.interfaces.synchronisation.SynchronisationService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.paylaods.request.*;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/synchronisation", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class SynchronisationController {
|
||||||
|
private final SynchronisationService synchronisationService;
|
||||||
|
|
||||||
|
public SynchronisationController(SynchronisationService synchronisationService) {
|
||||||
|
this.synchronisationService = synchronisationService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/user-decoupage-territorial")
|
||||||
|
public ResponseEntity<?> getUserDecoupageTerritorial() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.getDecoupageAdminUserConnecter(), "Liste des découpages territoriaux chargés avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/references")
|
||||||
|
public ResponseEntity<?> getAllReferences() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.getReferencesSyncResponses(), "Liste des données de référence chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/personnes")
|
||||||
|
public ResponseEntity<?> syncPersonne(@RequestBody List<PersonnePayLoad> personnePayLoads) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncPersonnes(personnePayLoads), "Liste des personnes synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@PostMapping("/membre-groupe")
|
||||||
|
public ResponseEntity<?> syncMembreGroupe(@RequestBody List<MembreGroupePayLoad> membreGroupePayLoads) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncMembreGroupe(membreGroupePayLoads), "Liste des membres de groupes de personnes synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@PostMapping("/enquete")
|
||||||
|
public ResponseEntity<?> syncEnquete(@RequestBody List<EnquetePayLoad> enquetePayLoads) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncEnquete(enquetePayLoads), "Liste des enquêtes synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@PostMapping("/parcelle")
|
||||||
|
public ResponseEntity<?> syncParcelle(@RequestBody List<ParcellePayLoad> parcellePayLoads) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncParcelle(parcellePayLoads), "Liste des parceclles synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@PostMapping("/piece")
|
||||||
|
public ResponseEntity<?> syncPiece(@RequestBody List<PiecePayLoad> piecePayLoads) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncPiece(piecePayLoads), "Liste des pièces synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@PostMapping("/acteur-concerne")
|
||||||
|
public ResponseEntity<?> syncActeurConcerne(@RequestBody List<ActeurConcernePayLoad> piecePayLoads) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncActeurConcerne(piecePayLoads), "Liste des acteurs concernes synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//@PostMapping("/files")
|
||||||
|
@PostMapping(path = "/files")
|
||||||
|
public ResponseEntity<?> syncFiles(@RequestPart(required = true) MultipartFile file,
|
||||||
|
@RequestParam(required=false) Long idBackend,
|
||||||
|
@RequestParam Long externalKey,
|
||||||
|
@RequestParam(required=false) Long pieceId,
|
||||||
|
@RequestParam(required=false) Long membreGroupeId,
|
||||||
|
@RequestParam(required=false) Long terminalId,
|
||||||
|
@RequestParam(required=false) String name,
|
||||||
|
@RequestParam(required=false) String filePath,
|
||||||
|
@RequestParam(required=false) Long max_numero_piece_id,
|
||||||
|
@RequestParam(required=false) Long max_numero_upload_id,
|
||||||
|
@RequestParam(required=false) Long max_numero_acteur_concerne_id,
|
||||||
|
@RequestParam(required=false) Long enqueteId
|
||||||
|
) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncFiles(file,
|
||||||
|
idBackend,
|
||||||
|
externalKey,
|
||||||
|
pieceId,
|
||||||
|
membreGroupeId,
|
||||||
|
terminalId,
|
||||||
|
name,
|
||||||
|
filePath,
|
||||||
|
max_numero_piece_id,
|
||||||
|
max_numero_upload_id,
|
||||||
|
max_numero_acteur_concerne_id,
|
||||||
|
enqueteId), "Liste des fichiers synchronisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(path = "/synchronise/all-enquete-data")
|
||||||
|
public ResponseEntity<?> syncAllEnqueteData(@ModelAttribute EnqueteAllDataPayload enqueteAllDataPayload) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncEnqueteAllData(enqueteAllDataPayload), "Les enquetes sont synchronisées avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(path = "/synchronise/enquete/confirme-from-mobile")
|
||||||
|
public ResponseEntity<?> syncAllEnqueteData(@RequestBody List<Long> idEnquetes) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, synchronisationService.syncEnqueteFromMobile(idEnquetes), "Synchronisation confirmée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
106
src/main/java/io/gmss/infocad/controllers/user/AuthController.java
Executable file
106
src/main/java/io/gmss/infocad/controllers/user/AuthController.java
Executable file
@@ -0,0 +1,106 @@
|
|||||||
|
package io.gmss.infocad.controllers.user;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.user.Role;
|
||||||
|
import io.gmss.infocad.entities.user.User;
|
||||||
|
import io.gmss.infocad.enums.UserRole;
|
||||||
|
import io.gmss.infocad.interfaces.infocad.parametre.StructureService;
|
||||||
|
import io.gmss.infocad.interfaces.user.RoleService;
|
||||||
|
import io.gmss.infocad.interfaces.user.UserService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.paylaods.JwtAuthenticationResponse;
|
||||||
|
import io.gmss.infocad.paylaods.Login;
|
||||||
|
import io.gmss.infocad.paylaods.UserRequest;
|
||||||
|
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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/auth", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class AuthController {
|
||||||
|
|
||||||
|
private final UserService userService;
|
||||||
|
private final RoleService roleService;
|
||||||
|
private final StructureService structureService;
|
||||||
|
|
||||||
|
public AuthController(UserService userService, RoleService roleService, StructureService structureService) {
|
||||||
|
this.userService = userService;
|
||||||
|
this.roleService = roleService;
|
||||||
|
this.structureService = structureService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/login")
|
||||||
|
public ResponseEntity<?> login(@RequestBody @Validated @Valid Login login) {
|
||||||
|
try{
|
||||||
|
JwtAuthenticationResponse jwtAuthenticationResponse = userService.loginUser(login);
|
||||||
|
|
||||||
|
if(!jwtAuthenticationResponse.getToken().isEmpty()){
|
||||||
|
User user = userService.getUserByUsername(login.getUsername());
|
||||||
|
if(user.isResetPassword()){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, jwtAuthenticationResponse, "Vous devez impérativement changer son mot de passe avant de pouvoir continuer toute action dans le logiciel infocad."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, jwtAuthenticationResponse, "Authentification réussie avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, "Authentification échouée."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<User>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/signup")
|
||||||
|
public ResponseEntity<?> createUser(@RequestBody @Valid @Validated UserRequest userRequest) {
|
||||||
|
try{
|
||||||
|
User user = getUser(userRequest);
|
||||||
|
user.setUsername(userRequest.getEmail());
|
||||||
|
user = userService.createUser(user, false);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, user, "User created successully."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private User getUser(UserRequest userRequest) {
|
||||||
|
User user = new User();
|
||||||
|
user.setNom(userRequest.getNom());
|
||||||
|
user.setPrenom(userRequest.getPrenom());
|
||||||
|
user.setTel(userRequest.getTelephone());
|
||||||
|
user.setEmail(userRequest.getEmail());
|
||||||
|
user.setUsername(userRequest.getEmail());
|
||||||
|
user.setPassword(userRequest.getPassword());
|
||||||
|
user.setActive(false);
|
||||||
|
Set<Role> roleSet = new HashSet<>();
|
||||||
|
roleSet.add(roleService.getRoleByRoleName(UserRole.ROLE_ANONYMOUS).get());
|
||||||
|
user.setRoles(roleSet);
|
||||||
|
user.setStructure(structureService.getStructureById(userRequest.getStructureId()).get());
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
package io.gmss.infocad.controllers.user;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.user.DemandeReinitialisationMP;
|
||||||
|
import io.gmss.infocad.entities.user.User;
|
||||||
|
import io.gmss.infocad.enums.UserRole;
|
||||||
|
import io.gmss.infocad.interfaces.user.DemandeReinitialisationMPService;
|
||||||
|
import io.gmss.infocad.interfaces.user.RoleService;
|
||||||
|
import io.gmss.infocad.interfaces.user.UserService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.paylaods.DemandeReinitialisationMPResponse;
|
||||||
|
import io.gmss.infocad.security.CurrentUser;
|
||||||
|
import io.gmss.infocad.security.UserPrincipal;
|
||||||
|
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.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/demande-reinitialisation-mp", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class DemandeReinitialisationMPController {
|
||||||
|
|
||||||
|
private final DemandeReinitialisationMPService demandeReinitialisationMPService;
|
||||||
|
private final UserService userService;
|
||||||
|
private final RoleService roleService;
|
||||||
|
|
||||||
|
public DemandeReinitialisationMPController(DemandeReinitialisationMPService demandeReinitialisationMPService, UserService userService, RoleService roleService) {
|
||||||
|
this.demandeReinitialisationMPService = demandeReinitialisationMPService;
|
||||||
|
this.userService = userService;
|
||||||
|
this.roleService = roleService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/create")
|
||||||
|
public ResponseEntity<?> createDemandeReinitialisationMP(@RequestParam String usernamrOrEmail) {
|
||||||
|
try {
|
||||||
|
demandeReinitialisationMPService.createDemandeReinitialisationMP(usernamrOrEmail);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, "DemandeReinitialisation MP créé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateDemandeReinitialisationMP(@PathVariable Long id, @RequestBody DemandeReinitialisationMP demandeReinitialisationMP) {
|
||||||
|
try {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, demandeReinitialisationMPService.updateDemandeReinitialisationMP(id, demandeReinitialisationMP), "DemandeReinitialisationMP mis à jour avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteDemandeReinitialisationMPr(@PathVariable Long id) {
|
||||||
|
try {
|
||||||
|
demandeReinitialisationMPService.deleteDemandeReinitialisationMP(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, "Demande de Reinitialisation de mot de passe supprimé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAllDemandeReinitialisationMPList(@CurrentUser UserPrincipal userPrincipal) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
User user = userPrincipal.getUser();
|
||||||
|
|
||||||
|
if(user.getRoles().stream().anyMatch(r -> r.getNom().equals(UserRole.ROLE_ADMIN))){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, demandeReinitialisationMPService.getDemandeReinitialisationMPList(), "Liste des demande de Reinitialisation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
if (user.getStructure() == null) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, "Cet utilisateur n'est pas dans une structure; on ne peut donc pas afficher les demandes de réinitialisation de mot de passe."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, demandeReinitialisationMPService.getDemandeReinitialisationMPNonTraiteList(user.getStructure()), "Liste des demande de Reinitialisation chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// }else {
|
||||||
|
// if (user.getStructure() == null) {
|
||||||
|
// return new ResponseEntity<>(
|
||||||
|
// new ApiResponse<>(false, "Cet utilisateur n'est pas dans une structure; on ne peut donc pas afficher les demandes de réinitialisation de mot de passe."),
|
||||||
|
// HttpStatus.OK
|
||||||
|
// );
|
||||||
|
// } else {
|
||||||
|
// return new ResponseEntity<>(
|
||||||
|
// new ApiResponse<>(true, demandeReinitialisationMPService.getDemandeReinitialisationMPNonTraiteList(user.getStructure()), "Liste des demande de Reinitialisation chargée avec succès."),
|
||||||
|
// HttpStatus.OK
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
} catch (Exception e) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllDemandeReinitialisationMPPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, demandeReinitialisationMPService.getDemandeReinitialisationMPList(pageable), "Liste des demandeReinitialisationMP chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getDemandeReinitialisationMPById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, demandeReinitialisationMPService.getDemandeReinitialisationMPById(id), "DemandeReinitialisationMP trouvé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/reset")
|
||||||
|
public ResponseEntity<?> traiterDemande(@RequestParam Long id, @RequestParam String password) {
|
||||||
|
DemandeReinitialisationMP demandeReinitialisationMP = demandeReinitialisationMPService.traiterDemandeReinitialisation(id, password);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,
|
||||||
|
new DemandeReinitialisationMPResponse(
|
||||||
|
userService.getUserResponseFromUser(demandeReinitialisationMP.getUser()),
|
||||||
|
demandeReinitialisationMP.getEtatDemande()
|
||||||
|
),
|
||||||
|
"Traitement effectué avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
93
src/main/java/io/gmss/infocad/controllers/user/RoleController.java
Executable file
93
src/main/java/io/gmss/infocad/controllers/user/RoleController.java
Executable file
@@ -0,0 +1,93 @@
|
|||||||
|
package io.gmss.infocad.controllers.user;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.user.Role;
|
||||||
|
import io.gmss.infocad.interfaces.user.RoleService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/role", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class RoleController {
|
||||||
|
|
||||||
|
private final RoleService roleService;
|
||||||
|
|
||||||
|
public RoleController(RoleService roleService) {
|
||||||
|
this.roleService = roleService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createRole(@RequestBody @Valid @Validated Role role) {
|
||||||
|
try{
|
||||||
|
role = roleService.createRole(role);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, role, "Role created successully."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateRole(@PathVariable Long id, @RequestBody Role role) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, roleService.updateRole(id, role), "Role updated successully."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteRole(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
roleService.deleteRole(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"Role deleted successully"),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAll() {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, roleService.getRoleList(), "Liste des roles."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-paged")
|
||||||
|
public ResponseEntity<?> getAllPaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, roleService.getRoleList(pageable), "Liste des roles."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
217
src/main/java/io/gmss/infocad/controllers/user/UserController.java
Executable file
217
src/main/java/io/gmss/infocad/controllers/user/UserController.java
Executable file
@@ -0,0 +1,217 @@
|
|||||||
|
package io.gmss.infocad.controllers.user;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.user.User;
|
||||||
|
import io.gmss.infocad.enums.UserRole;
|
||||||
|
import io.gmss.infocad.interfaces.user.UserService;
|
||||||
|
import io.gmss.infocad.paylaods.ApiResponse;
|
||||||
|
import io.gmss.infocad.paylaods.Login;
|
||||||
|
import io.gmss.infocad.security.CurrentUser;
|
||||||
|
import io.gmss.infocad.security.UserPrincipal;
|
||||||
|
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 javax.validation.Valid;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value = "api/user", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
|
public class UserController {
|
||||||
|
|
||||||
|
private final UserService userService;
|
||||||
|
|
||||||
|
|
||||||
|
public UserController(UserService userService) {
|
||||||
|
this.userService = userService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
public ResponseEntity<?> createUser(@RequestBody @Valid @Validated User user) {
|
||||||
|
try{
|
||||||
|
user.setUsername(user.getEmail());
|
||||||
|
user = userService.createUser(user, true);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, user, "Utilisateur créé avec succès"),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/change-password")
|
||||||
|
public ResponseEntity<?> changeUserPassword(@RequestBody @Valid @Validated Login login) {
|
||||||
|
try{
|
||||||
|
userService.updatePassword(login.getUsername(), login.getPassword());
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, "Votre mot de passe à été modifiée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/reset-password")
|
||||||
|
public ResponseEntity<?> resetUserPassword(@RequestBody @Valid @Validated Login login) {
|
||||||
|
try{
|
||||||
|
User user = userService.resetPassword(login.getUsername(), login.getPassword());
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, user, "Votre mot de passe à été réinitialisée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/validate-user-account")
|
||||||
|
public ResponseEntity<?> validateUserAccount(@RequestBody @Valid @Validated Login login) {
|
||||||
|
try{
|
||||||
|
User user = userService.validateUserAccount(login.getUsername(), login.getUserRole());
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, user, "Cet utilisateur à été activé avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PutMapping("/update/{id}")
|
||||||
|
public ResponseEntity<?> updateUser(@PathVariable Long id, @RequestBody User user) {
|
||||||
|
try{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.updateUser(id, user), "User updated successully."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping ("/activate-or-not")
|
||||||
|
public ResponseEntity<?> acitvateOrNotUser(@RequestParam Long id) {
|
||||||
|
try{
|
||||||
|
|
||||||
|
User user = userService.activateOrNotUser(id);
|
||||||
|
String message = "Utilisateur activé avec succès";
|
||||||
|
if(!user.isActive()) {
|
||||||
|
message = "Utilisateur désactivé avec succès";
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, user , message),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public ResponseEntity<?> deleteUser(@PathVariable Long id) {
|
||||||
|
try{
|
||||||
|
userService.deleteUser(id);
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,"User deleted successully"),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}catch (Exception e){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, e.getMessage()),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<?> getAll(@CurrentUser UserPrincipal userPrincipal) {
|
||||||
|
|
||||||
|
User user = userPrincipal.getUser();
|
||||||
|
|
||||||
|
if(user.getRoles().stream().anyMatch(r -> r.getNom().equals(UserRole.ROLE_ADMIN))){
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.getAllUserListResponse(), "Liste des utilisateurs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.getListUserResponseByStructure(userPrincipal.getUser().getStructure().getId()), "Liste des utilisateurs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-by-structure")
|
||||||
|
public ResponseEntity<?> getAllByStructure(@CurrentUser UserPrincipal userPrincipal) {
|
||||||
|
|
||||||
|
if(userPrincipal.getUser().getStructure() != null) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.getListUserByStructure(userPrincipal.getUser().getStructure().getId()), "Liste des utilisateurs chargée avec succès."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(false, "Impossible de trouver la structure indiquée."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @GetMapping("/all-paged")
|
||||||
|
// public ResponseEntity<?> getAllpaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
// Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
// return new ResponseEntity<>(
|
||||||
|
// new ApiResponse<>(true, userService.getUserList(pageable), "Liste des utilisateurs chargée avec succès."),
|
||||||
|
// HttpStatus.OK
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
@GetMapping("/id/{id}")
|
||||||
|
public ResponseEntity<?> getUserById(@PathVariable Long id) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.getUserById(id), "User found."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/username/{username}")
|
||||||
|
public ResponseEntity<?> getUserByUsername(@PathVariable String username) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.getUserByUsername(username), "User found."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/all-by-role/{userrole}")
|
||||||
|
public ResponseEntity<?> getUserByUserRole(@PathVariable UserRole userrole) {
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, userService.getUserByProfil(userrole), "Users found."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package io.gmss.infocad.deserializer;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
public class LocalDateDeserializer extends JsonDeserializer<LocalDate> {
|
||||||
|
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalDate deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||||
|
return LocalDate.parse(p.getText(), formatter);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package io.gmss.infocad.deserializer;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
public class LocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||||
|
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
|
||||||
|
return LocalDateTime.parse(p.getText(), formatter);
|
||||||
|
}
|
||||||
|
}
|
||||||
39
src/main/java/io/gmss/infocad/entities/BaseEntity.java
Executable file
39
src/main/java/io/gmss/infocad/entities/BaseEntity.java
Executable file
@@ -0,0 +1,39 @@
|
|||||||
|
package io.gmss.infocad.entities;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.data.annotation.CreatedBy;
|
||||||
|
import org.springframework.data.annotation.CreatedDate;
|
||||||
|
import org.springframework.data.annotation.LastModifiedBy;
|
||||||
|
import org.springframework.data.annotation.LastModifiedDate;
|
||||||
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||||
|
|
||||||
|
import javax.persistence.EntityListeners;
|
||||||
|
import javax.persistence.MappedSuperclass;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@MappedSuperclass
|
||||||
|
@EntityListeners(AuditingEntityListener.class)
|
||||||
|
|
||||||
|
public class BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@CreatedDate
|
||||||
|
@JsonIgnore
|
||||||
|
private Instant createdAt;
|
||||||
|
@LastModifiedDate
|
||||||
|
@JsonIgnore
|
||||||
|
private Instant updatedAt;
|
||||||
|
@CreatedBy
|
||||||
|
@JsonIgnore
|
||||||
|
private Long createdBy;
|
||||||
|
@LastModifiedBy
|
||||||
|
@JsonIgnore
|
||||||
|
private Long updatedBy;
|
||||||
|
@JsonIgnore
|
||||||
|
private boolean deleted;
|
||||||
|
private Long externalKey;
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package io.gmss.infocad.entities.decoupage;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Bloc;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Arrondissement extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
@ManyToOne
|
||||||
|
private Commune commune;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "arrondissement")
|
||||||
|
private List<Quartier> quartiers;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "arrondissement")
|
||||||
|
private List<Bloc> blocs;
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package io.gmss.infocad.entities.decoupage;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Commune extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
@ManyToOne
|
||||||
|
private Departement departement;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "commune")
|
||||||
|
private List<Arrondissement> arrondissements;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "commune")
|
||||||
|
private List<Personne> personnes;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package io.gmss.infocad.entities.decoupage;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Departement extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "departement")
|
||||||
|
private List<Commune> communes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package io.gmss.infocad.entities.decoupage;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE nationalite " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Nationalite extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
private String code;
|
||||||
|
private String indicatif;
|
||||||
|
private String nationality;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "nationalite")
|
||||||
|
private List<Personne> personnes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package io.gmss.infocad.entities.decoupage;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Quartier extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Arrondissement arrondissement;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.PositionRepresentation;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypeContestation;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypeRepresentation;
|
||||||
|
import io.gmss.infocad.enums.RoleActeur;
|
||||||
|
import io.gmss.infocad.enums.TypeDroit;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE acteur_concerne " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class ActeurConcerne extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String observation;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private TypeDroit typeDroit;
|
||||||
|
private float part;
|
||||||
|
@ManyToOne
|
||||||
|
private TypeRepresentation typeRepresentation;
|
||||||
|
@ManyToOne
|
||||||
|
private PositionRepresentation positionRepresentation;
|
||||||
|
@ManyToOne
|
||||||
|
private Personne personne;
|
||||||
|
@ManyToOne
|
||||||
|
private TypeContestation typeContestation;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Enquete enquete;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private RoleActeur roleActeur;
|
||||||
|
@OneToMany(mappedBy = "acteurConcerne")
|
||||||
|
private List<Piece> pieces;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
@Column(nullable = false, columnDefinition = "BOOLEAN DEFAULT false")
|
||||||
|
private boolean synchronise;
|
||||||
|
//////////////////////////////
|
||||||
|
private Long blocId;
|
||||||
|
@ColumnDefault("0")
|
||||||
|
private int haveDeclarant ;
|
||||||
|
private Long max_numero_acteur_concerne_id ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Arrondissement;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Quartier;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Structure;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE bloc " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Bloc extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@Column(updatable = false)
|
||||||
|
private String cote;
|
||||||
|
private String nom;
|
||||||
|
@JsonIgnore
|
||||||
|
private String idBlocParArrondissement;
|
||||||
|
@JsonIgnore
|
||||||
|
@Transient
|
||||||
|
private String nomArrondissement;
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(name = "blocs_quartiers",
|
||||||
|
joinColumns = @JoinColumn(name = "bloc_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "quartier_id")
|
||||||
|
)
|
||||||
|
private Set<Quartier> quartiers;
|
||||||
|
@ManyToOne
|
||||||
|
private Arrondissement arrondissement;
|
||||||
|
@ManyToOne
|
||||||
|
private Structure structure;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "bloc")
|
||||||
|
private List<Enquete> enquetes;
|
||||||
|
public String getNomArrondissement() {
|
||||||
|
return arrondissement.getNom();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.infocad.deserializer.LocalDateTimeDeserializer;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.enums.Origine;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE commentaire " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Commentaire extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy HH:mm:ss")
|
||||||
|
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||||
|
private LocalDateTime dateCommentaire;
|
||||||
|
private Long idEnquete;
|
||||||
|
private String commentaire;
|
||||||
|
private String nomPrenom;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private Origine origine;
|
||||||
|
private String nupParcelle;
|
||||||
|
@Column(name = "lu", nullable = false, columnDefinition = "BOOLEAN DEFAULT false")
|
||||||
|
private boolean lu = false;
|
||||||
|
@Column(name = "synchronise", nullable = false, columnDefinition = "BOOLEAN DEFAULT false")
|
||||||
|
private boolean synchronise = false;
|
||||||
|
private Long externalKey;
|
||||||
|
private Long terminalId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.infocad.deserializer.LocalDateDeserializer;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Arrondissement;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.NatureDomaine;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.CaracteristiqueParcelle;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.EnqueteBatiment;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.EnqueteUniteLogement;
|
||||||
|
import io.gmss.infocad.entities.user.User;
|
||||||
|
import io.gmss.infocad.enums.StatusEnquete;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Type;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE enquete " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||||||
|
@DiscriminatorColumn(name = "origine_enquete", discriminatorType = DiscriminatorType.STRING)
|
||||||
|
@DiscriminatorValue("INFOCAD")
|
||||||
|
public class Enquete extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateEnquete;
|
||||||
|
private boolean litige;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private User user;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "enquete")
|
||||||
|
private List<ActeurConcerne> acteurConcernes;
|
||||||
|
@ManyToOne
|
||||||
|
private Parcelle parcelle;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Bloc bloc;
|
||||||
|
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private StatusEnquete statusEnquete;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateValidation;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateRejet;
|
||||||
|
@Type(type="text")
|
||||||
|
private String descriptionMotifRejet;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateFinalisation;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateLitigeResolu;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateSynchronisation;
|
||||||
|
private boolean synchronise;
|
||||||
|
@Type(type="text")
|
||||||
|
private String observationParticuliere;
|
||||||
|
@Transient
|
||||||
|
private String nomPrenomEnqueteur;
|
||||||
|
@Transient
|
||||||
|
private String nomBloc;
|
||||||
|
@Transient
|
||||||
|
private String departement;
|
||||||
|
@Transient
|
||||||
|
private String commune;
|
||||||
|
@Transient
|
||||||
|
private String arrondissement;
|
||||||
|
@Transient
|
||||||
|
private String codeBloc;
|
||||||
|
@Transient
|
||||||
|
private String telEnqueteur;
|
||||||
|
@Transient
|
||||||
|
private String typeDomaine;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private String structureEnqueteur;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
@Transient
|
||||||
|
private Long terminalId;
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
private Long quartierId;
|
||||||
|
private Long arrondissementId;
|
||||||
|
private Long communeId;
|
||||||
|
private Long departementId;
|
||||||
|
private Long numeroProvisoir;
|
||||||
|
private String codeParcelle;
|
||||||
|
private String nomProprietaireParcelle;
|
||||||
|
private String codeEquipe;
|
||||||
|
private String numeroTitreFoncier;
|
||||||
|
|
||||||
|
/// Nouveau champs ajoutés pour RFU Abomey
|
||||||
|
private String numEnterParcelle;
|
||||||
|
private String numRue;
|
||||||
|
private String nomRue;
|
||||||
|
private String emplacement;
|
||||||
|
private float altitude;
|
||||||
|
private float precision;
|
||||||
|
private byte nbreCoProprietaire;
|
||||||
|
private byte nbreIndivisiaire;
|
||||||
|
private String autreAdresse;
|
||||||
|
private String surface;
|
||||||
|
private byte nbreBatiment;
|
||||||
|
private byte nbrePiscine;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateDebutExcemption;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateFinExcemption;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "enquete")
|
||||||
|
private List<EnqueteUniteLogement> enqueteUniteLogements;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "enquete")
|
||||||
|
private List<EnqueteBatiment> enqueteBatiments;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "enquete")
|
||||||
|
private List<CaracteristiqueParcelle> caracteristiqueParcelles;
|
||||||
|
|
||||||
|
|
||||||
|
public Long getTerminalId(){
|
||||||
|
if(this.terminal!=null){
|
||||||
|
return this.terminal.getId();
|
||||||
|
}else return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getNomPrenomEnqueteur(){
|
||||||
|
if(this.user!=null){
|
||||||
|
return this.user.getNom()+" "+this.user.getPrenom();
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
public String getNomBloc(){
|
||||||
|
if(this.bloc!=null){
|
||||||
|
return this.bloc.getNom();
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodeBloc(){
|
||||||
|
if(this.bloc!=null){
|
||||||
|
return this.bloc.getCote();
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
public String getDepartement(){
|
||||||
|
if(this.bloc!=null){
|
||||||
|
Arrondissement arrondissement= this.bloc.getArrondissement();
|
||||||
|
if(arrondissement!=null){
|
||||||
|
return arrondissement.getCommune().getDepartement().getNom();
|
||||||
|
}else return "";
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
public String getCommune(){
|
||||||
|
if(this.bloc!=null){
|
||||||
|
Arrondissement arrondissement= this.bloc.getArrondissement();
|
||||||
|
if(arrondissement!=null){
|
||||||
|
return arrondissement.getCommune().getNom();
|
||||||
|
}else return "";
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getArrondissement(){
|
||||||
|
if(this.bloc!=null){
|
||||||
|
Arrondissement arrondissement= this.bloc.getArrondissement();
|
||||||
|
if(arrondissement!=null){
|
||||||
|
return arrondissement.getNom();
|
||||||
|
}else return "";
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
public String getTypeDomaine(){
|
||||||
|
if(this.parcelle!=null){
|
||||||
|
NatureDomaine natureDomaine= this.parcelle.getNatureDomaine();
|
||||||
|
if(natureDomaine!=null){
|
||||||
|
return natureDomaine.getTypeDomaine().getLibelle();
|
||||||
|
}else return "";
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelEnqueteur(){
|
||||||
|
if(this.user !=null){
|
||||||
|
return this.user.getTel();
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStructureEnqueteur(){
|
||||||
|
if(this.user !=null){
|
||||||
|
return this.user.getStructure().getNom();
|
||||||
|
}else return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
public class EnqueteFiltreResponse{
|
||||||
|
@Id
|
||||||
|
private Long id;
|
||||||
|
private String parcelleid;
|
||||||
|
private Long communeid;
|
||||||
|
private String communenom;
|
||||||
|
private Long arrondissementid;
|
||||||
|
private String arrondissementnom;
|
||||||
|
private Long blocid;
|
||||||
|
private String blocnom;
|
||||||
|
private Long structureid;
|
||||||
|
private String structurenom;
|
||||||
|
private boolean litige;
|
||||||
|
private String statusenquete;
|
||||||
|
private LocalDate datefinalisation;
|
||||||
|
private LocalDate datevalidation;
|
||||||
|
private LocalDate datesynchronisation;
|
||||||
|
private boolean synchronise;
|
||||||
|
private String nomsigle;
|
||||||
|
private String prenomraisonsociale;
|
||||||
|
private String typepersonne;
|
||||||
|
private String typedomaine;
|
||||||
|
private String naturedomaine;
|
||||||
|
private String nupprovisoire;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.PositionRepresentation;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypeRepresentation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class MembreGroupe extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@ManyToOne
|
||||||
|
private Personne personneRepresantee; // la personne que l'on représente (PM ou PP)
|
||||||
|
@ManyToOne
|
||||||
|
private Personne personneRepresantante; // la personne qui représente la personne représentee
|
||||||
|
@ManyToOne
|
||||||
|
private TypeRepresentation typeRepresentation;
|
||||||
|
@ManyToOne
|
||||||
|
private PositionRepresentation positionRepresentation;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "membreGroupe")
|
||||||
|
private Set<Upload> uploads;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
|
||||||
|
private Long max_numero_piece_id;
|
||||||
|
private Long max_numero_acteur_concerne_id;
|
||||||
|
private Long enqueteId;
|
||||||
|
private Long blocId;
|
||||||
|
private String observation;
|
||||||
|
@ColumnDefault("false")
|
||||||
|
private boolean synchronise;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Quartier;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.NatureDomaine;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.Batiment;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE parcelle " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Parcelle extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String qip;
|
||||||
|
private String q;
|
||||||
|
@Column(unique = true)
|
||||||
|
private String nup;
|
||||||
|
@Column(unique = true)
|
||||||
|
private String nupProvisoire;
|
||||||
|
private String numeroParcelle;
|
||||||
|
private String longitude;
|
||||||
|
private String latitude;
|
||||||
|
private String situationGeographique;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "parcelle")
|
||||||
|
private List<Enquete> enquetes;
|
||||||
|
// @ManyToOne
|
||||||
|
// private SituationGeographique situationGeographique;
|
||||||
|
@ManyToOne
|
||||||
|
//private TypeDomaine typeDomaine;
|
||||||
|
private NatureDomaine natureDomaine;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Quartier quartier;
|
||||||
|
private String i;
|
||||||
|
private String p;
|
||||||
|
private String observation;
|
||||||
|
private String numTitreFoncier;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
|
||||||
|
private Long typeDomaineId;
|
||||||
|
private Long numeroProvisoire;
|
||||||
|
private Long blocId;
|
||||||
|
@ColumnDefault("false")
|
||||||
|
private boolean synchronise;
|
||||||
|
|
||||||
|
|
||||||
|
private Long idDerniereEnquete;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "parcelle")
|
||||||
|
private List<Batiment> batiments;
|
||||||
|
|
||||||
|
// @ColumnDefault("0")
|
||||||
|
// private int geomSrid;
|
||||||
|
//
|
||||||
|
// @JsonSerialize(using = GeometrySerializer.class)
|
||||||
|
// @JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||||
|
// @Column(name = "geom",columnDefinition = "geometry(MultiPolygon,4326)")
|
||||||
|
// private Point geometry;
|
||||||
|
//
|
||||||
|
// @JsonSerialize(using = GeometrySerializer.class)
|
||||||
|
// @JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||||
|
// @Column(name = "geom_32631",columnDefinition = "geometry(MultiPolygon,32631)")
|
||||||
|
// private Point geometry32631;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.infocad.deserializer.LocalDateDeserializer;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.ModeAcquisition;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.SourceDroit;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.TypePiece;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE piece " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Piece extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String url;
|
||||||
|
private String numeroPiece;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateExpiration;
|
||||||
|
@ManyToOne
|
||||||
|
private TypePiece typePiece;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Personne personne;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private ActeurConcerne acteurConcerne ;
|
||||||
|
@ManyToOne
|
||||||
|
private SourceDroit sourceDroit ;
|
||||||
|
@ManyToOne
|
||||||
|
private ModeAcquisition modeAcquisition ;
|
||||||
|
@OneToMany(mappedBy = "piece")
|
||||||
|
private List<Upload> uploads ;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
|
||||||
|
|
||||||
|
private Long max_numero_piece_id;
|
||||||
|
private Long max_numero_acteur_concerne_id;
|
||||||
|
private Long enqueteId;
|
||||||
|
private Long blocId;
|
||||||
|
@ColumnDefault("false")
|
||||||
|
private boolean synchronise;
|
||||||
|
private String observation;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE tpe " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Tpe extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String numeroEquipement;
|
||||||
|
@Column(unique = true)
|
||||||
|
private String identifier;
|
||||||
|
private String model;
|
||||||
|
private String codeEquipe;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "terminal")
|
||||||
|
private List<Enquete> enquetes;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.Batiment;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.UniteLogement;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class Upload extends BaseEntity implements Serializable {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private Long externalKey;
|
||||||
|
private String Observation;
|
||||||
|
private boolean synchronise;
|
||||||
|
private String fileName;
|
||||||
|
private String originalFileName;
|
||||||
|
@Transient
|
||||||
|
private String URIFile;
|
||||||
|
private String checkSum;
|
||||||
|
private long size;
|
||||||
|
private String mimeType;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Piece piece;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private MembreGroupe membreGroupe;
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String filePath;
|
||||||
|
private Long max_numero_piece_id;
|
||||||
|
private Long max_numero_upload_id;
|
||||||
|
private Long max_numero_acteur_concerne_id;
|
||||||
|
private Long enqueteId;
|
||||||
|
private Long blocId;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
private Batiment batiment;
|
||||||
|
@ManyToOne
|
||||||
|
private UniteLogement uniteLogement;
|
||||||
|
|
||||||
|
public Upload() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getURIFile() {
|
||||||
|
return this.serverContext()+fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String serverContext(){
|
||||||
|
return ServletUriComponentsBuilder.fromCurrentContextPath()
|
||||||
|
.path("/api/upload/downloadFile/")
|
||||||
|
.toUriString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Upload{" +
|
||||||
|
"id=" + id +
|
||||||
|
", fileName='" + fileName + '\'' +
|
||||||
|
", originalFileName='" + originalFileName + '\'' +
|
||||||
|
'}';
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Piece;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE mode_acquisition " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class ModeAcquisition extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "modeAcquisition")
|
||||||
|
//private List<SourceDroitExerce> sourceDroitExerces;
|
||||||
|
private List<Piece> pieces ;
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(name = "modeAcquisition_typePersonne",
|
||||||
|
joinColumns = @JoinColumn(name = "mode_acquisition_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "type_personne_id")
|
||||||
|
)
|
||||||
|
private Set<TypePersonne> typePersonnes;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Parcelle;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE nature_domaine " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class NatureDomaine extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
//@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private TypeDomaine typeDomaine;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "natureDomaine")
|
||||||
|
private List<Parcelle> parcelles;
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(name = "natureDomaine_typePersonne",
|
||||||
|
joinColumns = @JoinColumn(name = "nature_domaine_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "type_personne_id")
|
||||||
|
)
|
||||||
|
private Set<TypePersonne> typePersonnes;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Commune;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Nationalite;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.ActeurConcerne;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Piece;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Tpe;
|
||||||
|
import io.gmss.infocad.enums.Categorie;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE personne " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Personne extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String ifu;
|
||||||
|
private String nomOuSigle;
|
||||||
|
private String prenomOuRaisonSociale;
|
||||||
|
private String numRavip;
|
||||||
|
private String npi;
|
||||||
|
private String dateNaissanceOuConsti;
|
||||||
|
private String lieuNaissance;
|
||||||
|
private String tel1;
|
||||||
|
private String tel2;
|
||||||
|
private String adresse;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private Categorie categorie;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "personne")
|
||||||
|
private List<ActeurConcerne> acteurConcernes;
|
||||||
|
@ManyToOne
|
||||||
|
private SituationMatrimoniale situationMatrimoniale;
|
||||||
|
@ManyToOne
|
||||||
|
private Nationalite nationalite;
|
||||||
|
@ManyToOne
|
||||||
|
private TypePersonne typePersonne;
|
||||||
|
@ManyToOne
|
||||||
|
private Profession profession;
|
||||||
|
@ManyToOne
|
||||||
|
private Commune commune;
|
||||||
|
@OneToMany(mappedBy = "personne")
|
||||||
|
private List<Piece> pieces;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@ManyToOne
|
||||||
|
private Tpe terminal;
|
||||||
|
@ColumnDefault("0")
|
||||||
|
private int haveRepresentant;
|
||||||
|
private String ravipQuestion;
|
||||||
|
private String age;
|
||||||
|
private String nomJeuneFille;
|
||||||
|
private String nomMere;
|
||||||
|
private String prenomMere;
|
||||||
|
private String indicatifTel1;
|
||||||
|
private String indicatifTel2;
|
||||||
|
private String sexe;
|
||||||
|
@ColumnDefault("0")
|
||||||
|
private int mustHaveRepresentant;
|
||||||
|
private String filePath;
|
||||||
|
private String observation;
|
||||||
|
@ColumnDefault("false")
|
||||||
|
private boolean synchronise;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.ActeurConcerne;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.MembreGroupe;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE position_representation " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class PositionRepresentation extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "positionRepresentation")
|
||||||
|
private List<ActeurConcerne> acteurConcernes;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "positionRepresentation")
|
||||||
|
private List<MembreGroupe> membreGroupes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE profession " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Profession extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String libelle;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "profession")
|
||||||
|
private List<Personne> personnes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE situation_geographique " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class SituationGeographique extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
// @JsonIgnore
|
||||||
|
// @OneToMany(mappedBy = "situationGeographique")
|
||||||
|
// private List<Parcelle> parcelles;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE situation_matrimoniale " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class SituationMatrimoniale extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "situationMatrimoniale")
|
||||||
|
private List<Personne> personnes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Piece;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE source_droit " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class SourceDroit extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@Column(columnDefinition = "integer default 1")
|
||||||
|
private int tailleChampMin;
|
||||||
|
@Column(columnDefinition = "integer default 5")
|
||||||
|
private int tailleChampMax;
|
||||||
|
@Column(columnDefinition = "varchar(255) default 'text'")
|
||||||
|
private String typeChamp;
|
||||||
|
@Column(columnDefinition = "boolean default false")
|
||||||
|
private boolean temoin;
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(name = "sourcesDeDroits_ModesAcquisitions",
|
||||||
|
joinColumns = @JoinColumn(name = "sources_droits_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "modes_acquisitions_id")
|
||||||
|
)
|
||||||
|
private Set<ModeAcquisition> modeAcquisitions;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "sourceDroit")
|
||||||
|
//private List<SourceDroitExerce> sourceDroitExerces;
|
||||||
|
private List<Piece> pieces ;
|
||||||
|
@Column(columnDefinition = "boolean default false")
|
||||||
|
private boolean titreFoncier;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.ActeurConcerne;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Piece;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE source_droit_exerce " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class SourceDroitExerce extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@ManyToOne
|
||||||
|
private SourceDroit sourceDroit;
|
||||||
|
@ManyToOne
|
||||||
|
private ActeurConcerne acteurConcerne;
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(name = "pieces_sources_droits_exerces",
|
||||||
|
joinColumns = @JoinColumn(name = "sources_droits_exerce_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "piece_id")
|
||||||
|
)
|
||||||
|
private Set<Piece> pieces;
|
||||||
|
@ManyToOne
|
||||||
|
private ModeAcquisition modeAcquisition;
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.decoupage.Arrondissement;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Bloc;
|
||||||
|
import io.gmss.infocad.entities.user.User;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE structure " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Structure extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@Column(updatable = false)
|
||||||
|
private String code;
|
||||||
|
private String nom;
|
||||||
|
private String ifu;
|
||||||
|
private String rccm;
|
||||||
|
private String tel;
|
||||||
|
private String email;
|
||||||
|
private String adresse;
|
||||||
|
//@JsonIgnore
|
||||||
|
@ManyToMany
|
||||||
|
@JoinTable(name = "arrondissements_structures",
|
||||||
|
joinColumns = @JoinColumn(name = "structure_id"),
|
||||||
|
inverseJoinColumns = @JoinColumn(name = "arrondissement_id")
|
||||||
|
)
|
||||||
|
private Set<Arrondissement> arrondissements;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "structure")
|
||||||
|
private List<User> agents;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "structure")
|
||||||
|
private List<Bloc> blocs;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.ActeurConcerne;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE type_contestation " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class TypeContestation extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@ColumnDefault("true")
|
||||||
|
private boolean droitPropriete;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typeContestation")
|
||||||
|
private List<ActeurConcerne> acteurConcernes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE type_domaine " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class TypeDomaine extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
// @JsonIgnore
|
||||||
|
// @OneToMany(mappedBy = "typeDomaine")
|
||||||
|
// private List<Parcelle> parcelles;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typeDomaine")
|
||||||
|
private List<NatureDomaine> natureDomaines;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.enums.Categorie;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE type_personne " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class TypePersonne extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private Categorie categorie;
|
||||||
|
@Column(nullable = false, columnDefinition = "BOOLEAN DEFAULT false")
|
||||||
|
private boolean groupeOuvert;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typePersonne")
|
||||||
|
private List<Personne> personnes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Piece;
|
||||||
|
import io.gmss.infocad.enums.CategoriePiece;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE type_piece " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class TypePiece extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@Enumerated(EnumType.STRING)
|
||||||
|
private CategoriePiece categoriePiece;
|
||||||
|
@ColumnDefault("true")
|
||||||
|
private boolean temoin;
|
||||||
|
@ColumnDefault("true")
|
||||||
|
private boolean contestataire;
|
||||||
|
@ColumnDefault("true")
|
||||||
|
private boolean declarant;
|
||||||
|
@Column(columnDefinition = "integer default 1")
|
||||||
|
private int tailleChampMin;
|
||||||
|
@Column(columnDefinition = "integer default 5")
|
||||||
|
private int tailleChampMax;
|
||||||
|
@Column(columnDefinition = "varchar(255) default 'text'")
|
||||||
|
private String typeChamp;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typePiece")
|
||||||
|
private List<Piece> pieces;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package io.gmss.infocad.entities.infocad.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.ActeurConcerne;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.MembreGroupe;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE type_representation " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class TypeRepresentation extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String libelle;
|
||||||
|
@Column(columnDefinition = "boolean default false")
|
||||||
|
private boolean estUnique;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typeRepresentation")
|
||||||
|
private List<ActeurConcerne> acteurConcernes;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typeRepresentation")
|
||||||
|
private List<MembreGroupe> membreGroupes;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.infocad.deserializer.LocalDateDeserializer;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Parcelle;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Upload;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Batiment extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String nub;
|
||||||
|
private String code;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateConstruction;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "batiment")
|
||||||
|
private List<EnqueteBatiment> enqueteBatiments;
|
||||||
|
private Long idDerniereEnquete;
|
||||||
|
@ManyToOne
|
||||||
|
private Parcelle parcelle;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "batiment")
|
||||||
|
private List<UniteLogement> uniteLogements;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "batiment")
|
||||||
|
private List<Upload> uploads;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.rfu.parametre.Caracteristique;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE caracteristique_batiment " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class CaracteristiqueBatiment extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@ManyToOne
|
||||||
|
private EnqueteBatiment enqueteBatiment;
|
||||||
|
@ManyToOne
|
||||||
|
private Caracteristique caracteristique;
|
||||||
|
private String valeur;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Enquete;
|
||||||
|
import io.gmss.infocad.entities.rfu.parametre.Caracteristique;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE caracteristique_parcelle " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class CaracteristiqueParcelle extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@ManyToOne
|
||||||
|
private Enquete enquete;
|
||||||
|
@ManyToOne
|
||||||
|
private Caracteristique caracteristique;
|
||||||
|
private String valeur;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.rfu.parametre.Caracteristique;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE caracteristique_unite_logement " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class CaracteristiqueUniteLogement extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
@ManyToOne
|
||||||
|
private EnqueteUniteLogement enqueteUniteLogement;
|
||||||
|
@ManyToOne
|
||||||
|
private Caracteristique caracteristique;
|
||||||
|
private String valeur;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.infocad.deserializer.LocalDateDeserializer;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Enquete;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE enquete_batiment " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class EnqueteBatiment extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private float surfaceAuSol;
|
||||||
|
private String autreMenuisierie;
|
||||||
|
private String autreMur;
|
||||||
|
private boolean sbee;
|
||||||
|
private String numCompteurSbee;
|
||||||
|
private boolean soneb;
|
||||||
|
private String numCompteurSoneb;
|
||||||
|
private byte nbreLotUnite;
|
||||||
|
private byte nbreUniteLocation;
|
||||||
|
private float surfaceLouee;
|
||||||
|
private byte nbreMenage;
|
||||||
|
private byte nbreHabitant;
|
||||||
|
private float valeurMensuelleLocation;
|
||||||
|
private byte nbreMoisLocation;
|
||||||
|
private String autreCaracteristiquePhysique;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateDebutExcemption;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateFinExcemption;
|
||||||
|
@OneToOne
|
||||||
|
private Personne personne;
|
||||||
|
@ManyToOne
|
||||||
|
private Batiment batiment;
|
||||||
|
@ManyToOne
|
||||||
|
private Enquete enquete;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "enqueteBatiment")
|
||||||
|
List<CaracteristiqueBatiment> caracteristiqueBatiments;
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import io.gmss.infocad.deserializer.LocalDateDeserializer;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Enquete;
|
||||||
|
import io.gmss.infocad.entities.infocad.parametre.Personne;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.SQLDelete;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@SQLDelete(sql =
|
||||||
|
"UPDATE enquete_unite_logement " +
|
||||||
|
"SET deleted = true " +
|
||||||
|
"WHERE id = ?")
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class EnqueteUniteLogement extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private float surface;
|
||||||
|
private byte nbrePiece; //les champs byte sont des integer,
|
||||||
|
// c'est juste la taille en mémoire que je veux préserver
|
||||||
|
private byte nbreHabitant;
|
||||||
|
private byte nbreMenage;
|
||||||
|
private boolean enLocation;
|
||||||
|
private float montantMensuelLoyer;
|
||||||
|
private byte nbreMoisEnLocation;
|
||||||
|
private float montantLocatifAnnuelDeclare;
|
||||||
|
private float surfaceLouee;
|
||||||
|
private boolean sbee;
|
||||||
|
private boolean soneb;
|
||||||
|
private String numCompteurSbee;
|
||||||
|
private String numCompteurSoneb;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateDebutExcemption;
|
||||||
|
@JsonFormat(pattern = "dd-MM-yyyy")
|
||||||
|
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||||
|
private LocalDate dateFinExcemption;
|
||||||
|
@ManyToOne
|
||||||
|
private Enquete enquete;
|
||||||
|
@ManyToOne
|
||||||
|
private UniteLogement uniteLogement;
|
||||||
|
@OneToOne
|
||||||
|
private Personne personne;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "enqueteUniteLogement")
|
||||||
|
private List<CaracteristiqueUniteLogement> caracteristiqueUniteLogements;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.metier;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.infocad.metier.Upload;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class UniteLogement extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String nul;
|
||||||
|
private String numeroEtage;
|
||||||
|
private String code;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "uniteLogement")
|
||||||
|
private List<EnqueteUniteLogement> enqueteUniteLogements;
|
||||||
|
@ManyToOne
|
||||||
|
private Batiment batiment;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "uniteLogement")
|
||||||
|
private List<Upload> uploads;
|
||||||
|
private Long idDerniereEnquete;
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.CaracteristiqueBatiment;
|
||||||
|
import io.gmss.infocad.entities.rfu.metier.CaracteristiqueUniteLogement;
|
||||||
|
import io.gmss.infocad.enums.TypeImmeuble;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class Caracteristique extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String libelle;
|
||||||
|
private boolean actif;
|
||||||
|
private TypeImmeuble typeImmeuble;
|
||||||
|
@ManyToOne
|
||||||
|
private TypeCaracteristique typeCaracteristique;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "caracteristique")
|
||||||
|
private List<CaracteristiqueBatiment> caracteristiqueBatiments;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "caracteristique")
|
||||||
|
private List<CaracteristiqueUniteLogement> caracteristiqueUniteLogements;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package io.gmss.infocad.entities.rfu.parametre;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import io.gmss.infocad.entities.BaseEntity;
|
||||||
|
import io.gmss.infocad.enums.TypeImmeuble;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Where(clause = " deleted = false")
|
||||||
|
public class TypeCaracteristique extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
private String code;
|
||||||
|
private String libelle;
|
||||||
|
private boolean actif;
|
||||||
|
private boolean bati;
|
||||||
|
private boolean nonBati;
|
||||||
|
private TypeImmeuble typeImmeuble;
|
||||||
|
@JsonIgnore
|
||||||
|
@OneToMany(mappedBy = "typeCaracteristique")
|
||||||
|
private List<Caracteristique> caracteristiques;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user