Compare commits
39 Commits
aur-dgi01-
...
14feb49dcd
| Author | SHA1 | Date | |
|---|---|---|---|
| 14feb49dcd | |||
| d92a2b2503 | |||
| c1b93e0fcc | |||
| 39de1c48c0 | |||
| 5ccfdb6a3f | |||
| 4e832b3f0d | |||
| f9e2b32118 | |||
| 87b3bfbe83 | |||
| e27ec7a268 | |||
| 3ebb1cf165 | |||
| 62f25ea726 | |||
| 6c92d06c50 | |||
| c84176b8d3 | |||
| 6125fcbd0b | |||
| 9336715c18 | |||
| 61f4dd513f | |||
| 211af6103a | |||
| 4075fba99b | |||
| c34334376a | |||
| 5e9f437497 | |||
| d27b622db8 | |||
| 98d0187df4 | |||
| 69af57f876 | |||
| c80b40082c | |||
| 1d4a1f61c9 | |||
| 56f78e77f3 | |||
| 4a88af6487 | |||
| bc31074a24 | |||
| 0c7dc082fd | |||
| 966b0af1c2 | |||
| ad2c3c70b2 | |||
| 3f5d7e980c | |||
| 58aa088ac3 | |||
| ac624a62fb | |||
| 87be4e4483 | |||
| 033b430051 | |||
| 87615f210b | |||
| b8dbc7f625 | |||
| de2f149cf7 |
3
.env
@@ -1,3 +1,2 @@
|
||||
POSTGRES_DB=abomey_db
|
||||
POSTGRES_USER=infocad_user
|
||||
POSTGRES_PASSWORD=W5fwD({9*q53
|
||||
POSTGRES_USER=infocad_user
|
||||
132
.gitea/workflows/cd-main.yml
Normal file
@@ -0,0 +1,132 @@
|
||||
name: CD - Deploy on main
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
|
||||
# 1) S'assurer que Node.js est installé
|
||||
- name: Ensure Node.js is installed
|
||||
shell: sh
|
||||
run: |
|
||||
if command -v node >/dev/null 2>&1; then
|
||||
echo "Node.js already installed: $(node -v)"
|
||||
else
|
||||
apk update && apk add --no-cache nodejs
|
||||
echo "Node.js installed: $(node -v)"
|
||||
fi
|
||||
|
||||
# 2) S'assurer que Java 17 & Maven sont installés
|
||||
- name: Ensure Java & Maven are installed
|
||||
shell: sh
|
||||
run: |
|
||||
if ! command -v java >/dev/null 2>&1; then
|
||||
apk update && apk add --no-cache openjdk17-jdk
|
||||
fi
|
||||
java -version
|
||||
|
||||
if ! command -v mvn >/dev/null 2>&1; then
|
||||
apk update && apk add --no-cache maven
|
||||
fi
|
||||
mvn -version
|
||||
|
||||
# 3) Détecter JAVA_HOME dynamiquement
|
||||
- name: Detect JAVA_HOME dynamically
|
||||
shell: sh
|
||||
run: |
|
||||
JAVA_BIN=$(readlink -f "$(command -v java)")
|
||||
JAVA_HOME=$(dirname "$(dirname "$JAVA_BIN")")
|
||||
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
||||
|
||||
# 4) Checkout du dépôt
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 5) Informations de contexte (sans secrets)
|
||||
- name: Show context information
|
||||
shell: sh
|
||||
run: |
|
||||
echo "Commit:"
|
||||
git rev-parse HEAD
|
||||
echo "JAVA_HOME=$JAVA_HOME"
|
||||
java -version
|
||||
mvn -version
|
||||
|
||||
# 6) S'assurer que Docker CLI & docker-compose sont installés
|
||||
- name: Ensure Docker & docker-compose are installed
|
||||
shell: sh
|
||||
run: |
|
||||
if command -v docker >/dev/null 2>&1; then
|
||||
docker version || true
|
||||
else
|
||||
apk update && apk add --no-cache docker docker-compose
|
||||
docker version || true
|
||||
fi
|
||||
|
||||
# 7) Fournir la configuration NON sensible
|
||||
- name: Export database configuration
|
||||
shell: sh
|
||||
run: |
|
||||
echo "POSTGRES_DB_FISCAD=fiscad_db" >> "$GITHUB_ENV"
|
||||
echo "POSTGRES_USER_FISCAD=fiscad_user" >> "$GITHUB_ENV"
|
||||
|
||||
# 8) Création des secrets runtime (PRODUCTION)
|
||||
- name: Create runtime secrets
|
||||
shell: sh
|
||||
run: |
|
||||
mkdir -p secrets
|
||||
echo "${{ secrets.DEFAULT_USER_NAME }}" > secrets/defaultUserName.txt
|
||||
echo "${{ secrets.DEFAULT_USER_PASSWORD }}" > secrets/defaultUserPassword.txt
|
||||
echo "${{ secrets.POSTGRES_PASSWORD_FISCAD }}" > secrets/postgresPassword.txt
|
||||
chmod 600 secrets/*
|
||||
|
||||
# 9) Build Maven (jar final)
|
||||
- name: Build backend with Maven
|
||||
shell: sh
|
||||
run: mvn -B clean package -DskipTests
|
||||
|
||||
# 10) Déploiement avec docker-compose (prod)
|
||||
- name: Deploy using docker-compose (prod)
|
||||
shell: sh
|
||||
run: |
|
||||
export COMPOSE_PROJECT_NAME=fiscad
|
||||
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
ls -l secrets/
|
||||
|
||||
docker-compose -f docker-compose-prod.yml pull || true
|
||||
docker-compose -f docker-compose-prod.yml down --remove-orphans
|
||||
docker-compose -f docker-compose-prod.yml up -d --build
|
||||
|
||||
# 11) ✅ TEST BLOQUANT : connexion PostgreSQL
|
||||
- name: Test database connection
|
||||
shell: sh
|
||||
run: |
|
||||
echo "⏳ Waiting for PostgreSQL to be ready..."
|
||||
sleep 10
|
||||
|
||||
echo "🔍 Testing database connection..."
|
||||
docker exec fiscad-db sh -c "
|
||||
export PGPASSWORD=\$(cat /run/secrets/postgresPassword) &&
|
||||
psql -h localhost \
|
||||
-U ${POSTGRES_USER_FISCAD} \
|
||||
-d ${POSTGRES_DB_FISCAD} \
|
||||
-c 'SELECT 1;'
|
||||
"
|
||||
|
||||
# 12) Nettoyage des secrets (OBLIGATOIRE)
|
||||
- name: Cleanup secrets
|
||||
if: always()
|
||||
shell: sh
|
||||
run: rm -rf secrets
|
||||
|
||||
# 13) Nettoyage des images Docker inutilisées
|
||||
- name: Cleanup unused Docker images
|
||||
shell: sh
|
||||
run: docker image prune -f || true
|
||||
78
.gitea/workflows/ci-develop.yml
Normal file
@@ -0,0 +1,78 @@
|
||||
name: CI - Build & Test (develop)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: self-hosted
|
||||
|
||||
steps:
|
||||
|
||||
# 1) Node.js
|
||||
- name: Ensure Node.js is installed
|
||||
shell: sh
|
||||
run: |
|
||||
if command -v node >/dev/null 2>&1; then
|
||||
echo "Node.js already installed: $(node -v)"
|
||||
else
|
||||
apk update && apk add --no-cache nodejs
|
||||
echo "Node.js installed: $(node -v)"
|
||||
fi
|
||||
|
||||
# 2) Java & Maven
|
||||
- name: Ensure Java & Maven are installed
|
||||
shell: sh
|
||||
run: |
|
||||
if ! command -v java >/dev/null 2>&1; then
|
||||
apk update && apk add --no-cache openjdk17-jdk
|
||||
fi
|
||||
java -version
|
||||
|
||||
if ! command -v mvn >/dev/null 2>&1; then
|
||||
apk update && apk add --no-cache maven
|
||||
fi
|
||||
mvn -version
|
||||
|
||||
# 3) JAVA_HOME
|
||||
- name: Detect JAVA_HOME dynamically
|
||||
shell: sh
|
||||
run: |
|
||||
JAVA_BIN=$(readlink -f "$(command -v java)")
|
||||
JAVA_HOME=$(dirname "$(dirname "$JAVA_BIN")")
|
||||
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
|
||||
|
||||
# 4) Checkout
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 5) Secrets runtime (CI)
|
||||
- name: Create runtime secrets
|
||||
shell: sh
|
||||
run: |
|
||||
mkdir -p secrets
|
||||
echo "${{ secrets.DEFAULT_USER_NAME }}" > secrets/defaultUserName.txt
|
||||
echo "${{ secrets.DEFAULT_USER_PASSWORD }}" > secrets/defaultUserPassword.txt
|
||||
echo "${{ secrets.POSTGRES_PASSWORD_FISCAD }}" > secrets/postgresPassword.txt
|
||||
chmod 600 secrets/*
|
||||
|
||||
# 6) Vérification outils
|
||||
- name: Show Java & Maven versions
|
||||
shell: sh
|
||||
run: |
|
||||
echo "JAVA_HOME=$JAVA_HOME"
|
||||
java -version
|
||||
mvn -version
|
||||
|
||||
# 7) Build & tests
|
||||
- name: Build with Maven
|
||||
shell: sh
|
||||
run: mvn -B clean verify
|
||||
|
||||
# 8) Nettoyage
|
||||
- name: Cleanup secrets
|
||||
if: always()
|
||||
shell: sh
|
||||
run: rm -rf secrets
|
||||
2
.gitignore
vendored
@@ -3,3 +3,5 @@ fiscad.log*
|
||||
.DS_Store
|
||||
target/*
|
||||
ansible
|
||||
secrets/
|
||||
.env
|
||||
@@ -1,5 +1,5 @@
|
||||
# Étape 1 : Build avec Maven et Java 17
|
||||
FROM openjdk:17-jdk-slim
|
||||
FROM eclipse-temurin:17-jdk-jammy
|
||||
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
16598
dgi_zone_pilote.geojson
Normal file
74
docker-compose-prod.yml
Normal file
@@ -0,0 +1,74 @@
|
||||
services:
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: fiscad-db
|
||||
restart: always
|
||||
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB_FISCAD}
|
||||
POSTGRES_USER: ${POSTGRES_USER_FISCAD}
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgresPassword
|
||||
|
||||
secrets:
|
||||
- postgresPassword
|
||||
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
volumes:
|
||||
- db-data-fiscad:/var/lib/postgresql/data
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER_FISCAD}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: fiscad-app
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB_FISCAD}
|
||||
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER_FISCAD}
|
||||
SPRING_DATASOURCE_PASSWORD_FILE: /run/secrets/postgresPassword
|
||||
|
||||
SERVER_PORT: 8282
|
||||
IO_GMSS_FISCAD_PROFILE: abomey
|
||||
SPRING_PROFILES_ACTIVE: abomey
|
||||
|
||||
DEFAULT_USER_NAME_FILE: /run/secrets/defaultUserName
|
||||
DEFAULT_USER_PASSWORD_FILE: /run/secrets/defaultUserPassword
|
||||
|
||||
secrets:
|
||||
- postgresPassword
|
||||
- defaultUserName
|
||||
- defaultUserPassword
|
||||
|
||||
ports:
|
||||
- "8282:8282"
|
||||
|
||||
volumes:
|
||||
- /fiscad/uploads:/app/uploads
|
||||
- /fiscad/jasperReport:/app/jasperReport
|
||||
- /fiscad/logs:/app/logs
|
||||
|
||||
|
||||
volumes:
|
||||
db-data-fiscad:
|
||||
|
||||
|
||||
secrets:
|
||||
postgresPassword:
|
||||
file: ./secrets/postgresPassword.txt
|
||||
defaultUserName:
|
||||
file: ./secrets/defaultUserName.txt
|
||||
defaultUserPassword:
|
||||
file: ./secrets/defaultUserPassword.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '3.9'
|
||||
#version: '3.9'
|
||||
|
||||
services:
|
||||
|
||||
@@ -6,41 +6,73 @@ services:
|
||||
image: postgres:15
|
||||
container_name: fiscad-db
|
||||
restart: always
|
||||
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB_FISCAD}
|
||||
POSTGRES_USER: ${POSTGRES_USER_FISCAD}
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgresPassword
|
||||
|
||||
secrets:
|
||||
- postgresPassword
|
||||
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: fiscad-app
|
||||
restart: on-failure
|
||||
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB}
|
||||
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
|
||||
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB_FISCAD}
|
||||
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER_FISCAD}
|
||||
SPRING_DATASOURCE_PASSWORD_FILE: /run/secrets/postgresPassword
|
||||
|
||||
SERVER_PORT: 8282
|
||||
IO_GMSS_FISCAD_PROFILE: abomey
|
||||
SPRING_PROFILES_ACTIVE: abomey
|
||||
IO_GMSS_FISCAD_PROFILE: dgi
|
||||
SPRING_PROFILES_ACTIVE: dgi
|
||||
|
||||
# 🔐 Secrets Spring (fichiers)
|
||||
DEFAULT_USER_NAME_FILE: /run/secrets/defaultUserName
|
||||
DEFAULT_USER_PASSWORD_FILE: /run/secrets/defaultUserPassword
|
||||
|
||||
secrets:
|
||||
- defaultUserName
|
||||
- defaultUserPassword
|
||||
- postgresPassword
|
||||
|
||||
ports:
|
||||
- "8282:8282"
|
||||
|
||||
volumes:
|
||||
- ./uploads:/app/uploads
|
||||
- ./jasperReport:/app/jasperReport
|
||||
- ./logs:/app/logs
|
||||
restart: on-failure
|
||||
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
db-data:
|
||||
|
||||
|
||||
secrets:
|
||||
defaultUserName:
|
||||
file: /secrets/defaultUserName.txt
|
||||
defaultUserPassword:
|
||||
file: ./secrets/defaultUserPassword.txt
|
||||
postgresPassword:
|
||||
file: ./secrets/postgresPassword.txt
|
||||
1
secrets/defaultUserName.txt
Normal file
@@ -0,0 +1 @@
|
||||
infocad_admin
|
||||
1
secrets/defaultUserPassword.txt
Normal file
@@ -0,0 +1 @@
|
||||
admin@123
|
||||
@@ -20,8 +20,11 @@ public class DataLoadConfig {
|
||||
private final UserRepository userRepository;
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
@Value("${app.sourcemind.env.defaultpassword}")
|
||||
private String defaultPassword;
|
||||
@Value("${DEFAULT_USER_NAME_FILE}")
|
||||
private String usernameFile;
|
||||
|
||||
@Value("${DEFAULT_USER_PASSWORD_FILE}")
|
||||
private String passwordFile;
|
||||
|
||||
public DataLoadConfig(RoleRepository roleRepository, UserRepository userRepository, PasswordEncoder passwordEncoder) {
|
||||
this.roleRepository = roleRepository;
|
||||
@@ -52,14 +55,14 @@ public class DataLoadConfig {
|
||||
}
|
||||
|
||||
public void loadUsers() {
|
||||
if (userRepository.countAllByUsernameIsNotNull() == 0) {
|
||||
if (userRepository.existsByUsername(usernameFile) ) {
|
||||
User admin = new User();
|
||||
admin.setUsername("administrateur@infocad.bj");
|
||||
admin.setUsername(usernameFile);
|
||||
admin.setEmail("administrateur@infocad.bj");
|
||||
admin.setTel("N/A");
|
||||
admin.setNom("Administrateur");
|
||||
admin.setPrenom("Principal");
|
||||
admin.setPassword(passwordEncoder.encode(defaultPassword));
|
||||
admin.setPassword(passwordEncoder.encode(passwordFile));
|
||||
admin.setActive(true);
|
||||
Set<Role> roles = new HashSet<>();
|
||||
roles.add(roleRepository.findRoleByNom(UserRole.ROLE_ADMIN).get());
|
||||
|
||||
@@ -13,16 +13,16 @@ import io.swagger.v3.oas.annotations.servers.Server;
|
||||
@OpenAPIDefinition(
|
||||
info = @Info(
|
||||
contact = @Contact(
|
||||
name = "Novatic",
|
||||
email = "contact@novatic.org",
|
||||
url = "https://novatic.org"
|
||||
name = "ABS Company Bénin",
|
||||
email = "contact@abs.org",
|
||||
url = "https://abs.org"
|
||||
),
|
||||
description = "Cette page présente toutes les ressources API pour la gestion des données socio-foncières et fiscales",
|
||||
title = "FISCAD",
|
||||
version = "1.0",
|
||||
license = @License(
|
||||
name = "Licence name",
|
||||
url = "https://novatic.org"
|
||||
url = "https://abs.org"
|
||||
),
|
||||
termsOfService = "Terms of service"
|
||||
),
|
||||
@@ -33,7 +33,7 @@ import io.swagger.v3.oas.annotations.servers.Server;
|
||||
),
|
||||
@Server(
|
||||
description = "TEST ENV (http)",
|
||||
url = "http://novatic.vps.webdock.cloud:8282"
|
||||
url = "https://backend.fiscad-test.novatic.org"
|
||||
),
|
||||
@Server(
|
||||
description = "PROD ENV (https)",
|
||||
|
||||
@@ -56,13 +56,21 @@ public class ParcelleGeomController {
|
||||
}
|
||||
|
||||
@GetMapping("/by-quartier/{codeQuartier}")
|
||||
public ResponseEntity<?> getAllTpeList(@PathVariable String codeQuartier) {
|
||||
public ResponseEntity<?> getParcellesGeomsByQuartier(@PathVariable String codeQuartier) {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnQuatier(codeQuartier), "Liste des parcelle chargée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
}
|
||||
|
||||
@GetMapping("/by-arrondissement/{codeArrondissement}")
|
||||
public ResponseEntity<?> getParcellesGeomsByArrondissement(@PathVariable String codeArrondissement) {
|
||||
return new ResponseEntity<>(
|
||||
new ApiResponse<>(true, parcelleGeomService.getParcelleGeomListUnArrondissement(codeArrondissement), "Liste des parcelle chargée avec succès."),
|
||||
HttpStatus.OK
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/all-paged")
|
||||
public ResponseEntity<?> getAllTpePaged(@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||
|
||||
@@ -50,27 +50,35 @@ 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;
|
||||
|
||||
private Long mobileDataId;
|
||||
|
||||
@JsonIgnore
|
||||
@OneToMany(mappedBy = "enquete")
|
||||
private List<ActeurConcerne> acteurConcernes;
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Parcelle parcelle;
|
||||
|
||||
private Long parcelleExternalKey;
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
private Bloc bloc;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
private Campagne campagne;
|
||||
|
||||
@@ -80,6 +88,7 @@ public class Enquete extends BaseEntity implements Serializable {
|
||||
|
||||
@JsonIgnore
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "proprietaire_id")
|
||||
private Personne personne ;
|
||||
|
||||
@JsonIgnore
|
||||
@@ -158,9 +167,11 @@ public class Enquete extends BaseEntity implements Serializable {
|
||||
private String surface;
|
||||
private int nbreBatiment;
|
||||
private int 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;
|
||||
|
||||
@@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import io.gmss.fiscad.entities.BaseEntity;
|
||||
import io.gmss.fiscad.entities.decoupage.Arrondissement;
|
||||
import io.gmss.fiscad.entities.decoupage.Commune;
|
||||
import io.gmss.fiscad.entities.decoupage.Departement;
|
||||
import io.gmss.fiscad.entities.decoupage.Quartier;
|
||||
import io.gmss.fiscad.enums.StatutParcelle;
|
||||
import jakarta.persistence.*;
|
||||
@@ -26,16 +29,20 @@ import java.io.Serializable;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SQLDelete(sql =
|
||||
"UPDATE parcelle " +
|
||||
"SET deleted = true " +
|
||||
"WHERE id = ?")
|
||||
@Where(clause = " deleted = false")
|
||||
//@SQLDelete(sql =
|
||||
// "UPDATE parcelle " +
|
||||
// "SET deleted = true " +
|
||||
// "WHERE id = ?")
|
||||
//@Where(clause = " deleted = false")
|
||||
public class ParcelleGeom extends BaseEntity implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String NomDepartement;
|
||||
private String NomCommune;
|
||||
private String NomArrondissement;
|
||||
private String NomVillageQuartier;
|
||||
private String codeBloc;
|
||||
private String q;
|
||||
private String ilot;
|
||||
private String zone;
|
||||
@@ -47,60 +54,51 @@ public class ParcelleGeom extends BaseEntity implements Serializable {
|
||||
private String longitude;
|
||||
private String latitude;
|
||||
private String pointsPolygone;
|
||||
//////////
|
||||
private String departement;
|
||||
private String commune;
|
||||
private String arrondissement;
|
||||
private String villageQuartier;
|
||||
private String codeBloc;
|
||||
//private String codeParcelle;
|
||||
private String codeEquipe;
|
||||
private Integer superficie;
|
||||
private String elNumeroEtatLieux;
|
||||
private String elLot;
|
||||
private String elLettreParcelle;
|
||||
private String rfuQuartierOuZone;
|
||||
private String rfuIlot;
|
||||
private String rfuLettreParcelle;
|
||||
private String dateCollecte;
|
||||
private String nomLotissement;
|
||||
private String nomEtPrenoms;
|
||||
private String sourceCollecte;
|
||||
private String dateCollecte;
|
||||
private String sourceDonnees;
|
||||
private String observations;
|
||||
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
private StatutParcelle statutParcelle;
|
||||
|
||||
// @JsonIgnore
|
||||
// @ManyToOne
|
||||
// private Upload upload;
|
||||
|
||||
private Long uploadId;
|
||||
@ManyToOne
|
||||
private Departement departement;
|
||||
@ManyToOne
|
||||
private Commune commune;
|
||||
@ManyToOne
|
||||
private Arrondissement arrondissement;
|
||||
@ManyToOne
|
||||
private Quartier quartier ;
|
||||
@ColumnDefault("0")
|
||||
private int geomSrid;
|
||||
@JsonSerialize(using = GeometrySerializer.class)
|
||||
@JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||
@Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)")
|
||||
private Polygon geometry;
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String geometryString;
|
||||
private String codeInsae;
|
||||
private String numeroEtatLieux;
|
||||
private String numeroTitreFoncier;
|
||||
private String telephone;
|
||||
//private String codeParcelle;
|
||||
//private String codeEquipe;
|
||||
|
||||
//private String elLot;
|
||||
//private String elLettreParcelle;
|
||||
//private String rfuQuartierOuZone;
|
||||
//private String rfuIlot;
|
||||
//private String rfuLettreParcelle;
|
||||
|
||||
//private String nomLotissement;
|
||||
////////////
|
||||
|
||||
// @JsonIgnore
|
||||
// @OneToOne
|
||||
// private Parcelle parcelle;
|
||||
|
||||
@ManyToOne
|
||||
private Quartier quartier;
|
||||
|
||||
@ColumnDefault("0")
|
||||
private int geomSrid;
|
||||
|
||||
// @JsonSerialize(using = GeometrySerializer.class)
|
||||
// @JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||
// @Column(name = "geom",columnDefinition = "geometry(Polygon,4326)")
|
||||
// private Polygon geometry ;
|
||||
|
||||
@JsonSerialize(using = GeometrySerializer.class)
|
||||
@JsonDeserialize(contentUsing = GeometryDeserializer.class)
|
||||
@Column(name = "geometry",columnDefinition = "geometry(Polygon,32631)")
|
||||
private Polygon geometry;
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
private String geometryString;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.io.Serializable;
|
||||
@Setter
|
||||
@Table(
|
||||
indexes = {
|
||||
@Index(name = "idx_terminal_external_bat", columnList = "terminalId, externalKey")
|
||||
@Index(name = "idx_terminal_external_dnc", columnList = "terminalId, externalKey")
|
||||
}
|
||||
)
|
||||
public class MobileDataDeclarationNc extends BaseEntity implements Serializable {
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.io.Serializable;
|
||||
@Setter
|
||||
@Table(
|
||||
indexes = {
|
||||
@Index(name = "idx_terminal_external_bat", columnList = "terminalId, externalKey")
|
||||
@Index(name = "idx_terminal_external_activite", columnList = "terminalId, externalKey")
|
||||
}
|
||||
)
|
||||
public class MobileDataEnqueteActivite extends BaseEntity implements Serializable {
|
||||
|
||||
@@ -49,8 +49,9 @@ public class EnqueteActivite extends BaseEntity implements Serializable {
|
||||
@JsonDeserialize(using = LocalDateDeserializer.class)
|
||||
private LocalDate dateEnquete;
|
||||
|
||||
@Column(columnDefinition = "false")
|
||||
@Column(columnDefinition = "boolean default false", nullable = false)
|
||||
private boolean estDeclarer;
|
||||
|
||||
private String nc;
|
||||
private Long ChiffreAffaire;
|
||||
private String NumeroRccm;
|
||||
|
||||
@@ -120,28 +120,28 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
|
||||
}
|
||||
parcelleGeom.setUploadId(upload.getId());
|
||||
|
||||
parcelleGeom.setDepartement(propertiesNode.get("DEPARTEMENT").textValue());
|
||||
parcelleGeom.setCommune(propertiesNode.get("COMMUNE").textValue());
|
||||
parcelleGeom.setArrondissement(propertiesNode.get("ARRONDISSEMENT").textValue());
|
||||
parcelleGeom.setVillageQuartier(propertiesNode.get("VILLAGE_QUARTIER").textValue());
|
||||
parcelleGeom.setCodeBloc(propertiesNode.get("CODE_BLOC").textValue());
|
||||
parcelleGeom.setNupProvisoire(propertiesNode.get("CODE_PARCELLE").textValue());
|
||||
parcelleGeom.setCodeEquipe(propertiesNode.get("CODE_EQUIPE").textValue());
|
||||
try {
|
||||
parcelleGeom.setSuperficie(Integer.parseInt(propertiesNode.get("SUPERFICIE").textValue()));
|
||||
}catch (Exception e){
|
||||
}
|
||||
parcelleGeom.setElNumeroEtatLieux(propertiesNode.get("EL_NUMERO_ETAT_LIEUX").textValue());
|
||||
parcelleGeom.setElLot(propertiesNode.get("EL_LOT").textValue());
|
||||
parcelleGeom.setRfuQuartierOuZone(propertiesNode.get("RFU_QUARTIER_OU_ZONE").textValue());
|
||||
parcelleGeom.setElLettreParcelle(propertiesNode.get("EL_LETTRE_PARCELLE").textValue());
|
||||
parcelleGeom.setRfuIlot(propertiesNode.get("RFU_ILOT").textValue());
|
||||
parcelleGeom.setRfuLettreParcelle(propertiesNode.get("RFU_LETTRE_PARCELLE").textValue());
|
||||
parcelleGeom.setDateCollecte(propertiesNode.get("DATE_COLLECTE").textValue());
|
||||
parcelleGeom.setNomLotissement(propertiesNode.get("NOM_LOTISSEMENT").textValue());
|
||||
parcelleGeom.setNomEtPrenoms(propertiesNode.get("NOM_ET_PRENOMS").textValue());
|
||||
parcelleGeom.setSourceCollecte(propertiesNode.get("SOURCE_COLLECTE").textValue());
|
||||
parcelleGeom.setObservations(propertiesNode.get("OBSERVATIONS").textValue());
|
||||
// parcelleGeom.setDepartement(propertiesNode.get("DEPARTEMENT").textValue());
|
||||
// parcelleGeom.setCommune(propertiesNode.get("COMMUNE").textValue());
|
||||
// parcelleGeom.setArrondissement(propertiesNode.get("ARRONDISSEMENT").textValue());
|
||||
// parcelleGeom.setVillageQuartier(propertiesNode.get("VILLAGE_QUARTIER").textValue());
|
||||
// parcelleGeom.setCodeBloc(propertiesNode.get("CODE_BLOC").textValue());
|
||||
// parcelleGeom.setNupProvisoire(propertiesNode.get("CODE_PARCELLE").textValue());
|
||||
// parcelleGeom.setCodeEquipe(propertiesNode.get("CODE_EQUIPE").textValue());
|
||||
// try {
|
||||
// parcelleGeom.setSuperficie(Integer.parseInt(propertiesNode.get("SUPERFICIE").textValue()));
|
||||
// }catch (Exception e){
|
||||
// }
|
||||
// parcelleGeom.setElNumeroEtatLieux(propertiesNode.get("EL_NUMERO_ETAT_LIEUX").textValue());
|
||||
// parcelleGeom.setElLot(propertiesNode.get("EL_LOT").textValue());
|
||||
// parcelleGeom.setRfuQuartierOuZone(propertiesNode.get("RFU_QUARTIER_OU_ZONE").textValue());
|
||||
// parcelleGeom.setElLettreParcelle(propertiesNode.get("EL_LETTRE_PARCELLE").textValue());
|
||||
// parcelleGeom.setRfuIlot(propertiesNode.get("RFU_ILOT").textValue());
|
||||
// parcelleGeom.setRfuLettreParcelle(propertiesNode.get("RFU_LETTRE_PARCELLE").textValue());
|
||||
// parcelleGeom.setDateCollecte(propertiesNode.get("DATE_COLLECTE").textValue());
|
||||
// parcelleGeom.setNomLotissement(propertiesNode.get("NOM_LOTISSEMENT").textValue());
|
||||
// parcelleGeom.setNomEtPrenoms(propertiesNode.get("NOM_ET_PRENOMS").textValue());
|
||||
// parcelleGeom.setSourceCollecte(propertiesNode.get("SOURCE_COLLECTE").textValue());
|
||||
// parcelleGeom.setObservations(propertiesNode.get("OBSERVATIONS").textValue());
|
||||
parcelleGeom= parcelleGeomRepository.save(parcelleGeom);
|
||||
try {
|
||||
setStatutParcelleGeomFromGeoJson(parcelleGeom);
|
||||
@@ -180,6 +180,11 @@ public class ParcelleGeomServiceImpl implements ParcelleGeomService {
|
||||
return parcelleGeomRepository.findAllByQuartier_Code(codeQuartier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement) {
|
||||
return parcelleGeomRepository.findAllByQuartier_Arrondissement_Code(codeArrondissement);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ public interface ParcelleGeomService {
|
||||
Page<ParcelleGeom> getParcelleGeomList(Pageable pageable);
|
||||
List<ParcelleGeom> getParcelleGeomList();
|
||||
List<ParcelleGeom> getParcelleGeomListUnQuatier(String codeQuartier);
|
||||
public List<ParcelleGeom> getParcelleGeomListUnArrondissement(String codeArrondissement);
|
||||
|
||||
Optional<ParcelleGeom> getParcelleGeomById(Long id);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class EnqueteActivitePayload {
|
||||
private Long idBackend;
|
||||
private Long externalKey;
|
||||
private Long terminalId;
|
||||
private Long ChiffreAffaire;
|
||||
private Long ChiffreAffaire; // Todo : Revoir le nom de la variable 15/12/2015
|
||||
private String NumeroRccm;
|
||||
private boolean synchronise;
|
||||
private String observation;
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.Optional;
|
||||
public interface ParcelleGeomRepository extends JpaRepository<ParcelleGeom, Long> {
|
||||
|
||||
List<ParcelleGeom> findAllByQuartier_Code(String code);
|
||||
List<ParcelleGeom> findAllByQuartier_Arrondissement_Code(String code);
|
||||
|
||||
Optional<ParcelleGeom> findFirstByNupProvisoire(String numProvisoir);
|
||||
@Modifying
|
||||
|
||||
@@ -14,6 +14,8 @@ public interface UserRepository extends JpaRepository<User, Long> {
|
||||
|
||||
Optional<User> findByUsername(String username);
|
||||
|
||||
boolean existsByUsername(String username);
|
||||
|
||||
long countAllByUsernameIsNotNull();
|
||||
|
||||
List<User> findAllByStructureAndRolesIn(Structure structure, Set<Role> roleSet);
|
||||
|
||||
@@ -14,5 +14,5 @@ io.gmss.fiscad.profile=${IO_GMSS_FISCAD_PROFILE}
|
||||
# PROD ENV
|
||||
spring.datasource.url=${SPRING_DATASOURCE_URL}
|
||||
spring.datasource.username=${SPRING_DATASOURCE_USERNAME}
|
||||
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD}
|
||||
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD_FILE}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ io.gmss.fiscad.profile=dgi
|
||||
#spring.datasource.username=infocad_user
|
||||
#spring.datasource.password=W5fwD({9*q53
|
||||
# LOCAL ENV
|
||||
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/fiscad_dgi
|
||||
spring.datasource.username=infocad_user
|
||||
spring.datasource.password=W5fwD({9*q53
|
||||
|
||||
@@ -11,7 +11,7 @@ jwt.jwtExpirationInMs=7776000000
|
||||
spring.application.name=infocad
|
||||
#logging.file.name=fiscad.log
|
||||
logging.level.org.springframework.security=DEBUG
|
||||
app.sourcemind.env.defaultpassword=1234567890
|
||||
|
||||
app.sourcemind.env.resetlink=http://localhost:4200/reset-password/
|
||||
spring.mail.host=sandbox.smtp.mailtrap.io
|
||||
spring.mail.port=587
|
||||
@@ -42,6 +42,13 @@ file.upload_dir=./uploads
|
||||
file.jasper-reports=./jasperReport
|
||||
logging.file.name=/app/logs/fiscad.log
|
||||
|
||||
#app.abs.env.defaultpassword = 1234567890
|
||||
|
||||
#app.abs.env.defaultuser = infocad_admin
|
||||
|
||||
app.default-user.username=${DEFAULT_USER_NAME_FILE}
|
||||
app.default-user.password=${DEFAULT_USER_PASSWORD_FILE}
|
||||
|
||||
app.upload.root=${file.upload_dir}
|
||||
app.upload.zips.received=${app.upload.root}/zips/received
|
||||
app.upload.zips.done=${app.upload.root}/zips/done
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 158 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 489 KiB |
|
Before Width: | Height: | Size: 489 KiB |
|
Before Width: | Height: | Size: 470 KiB |
|
Before Width: | Height: | Size: 470 KiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 335 KiB |
|
Before Width: | Height: | Size: 335 KiB |
|
Before Width: | Height: | Size: 352 KiB |
|
Before Width: | Height: | Size: 352 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 317 KiB |
|
Before Width: | Height: | Size: 317 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 4.3 MiB |
|
Before Width: | Height: | Size: 4.3 MiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 266 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |