Merge pull request 'gestion processus de traitement des declarations de propriete' (#250) from features/fiche_refonte into develop
Reviewed-on: #250
This commit was merged in pull request #250.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package io.gmss.fiscad.controllers.rfu.metier;
|
package io.gmss.fiscad.controllers.rfu.metier;
|
||||||
|
|
||||||
|
|
||||||
|
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||||
import io.gmss.fiscad.exceptions.*;
|
import io.gmss.fiscad.exceptions.*;
|
||||||
import io.gmss.fiscad.interfaces.interface_sigibe.EdeclarationProprieteService;
|
import io.gmss.fiscad.interfaces.interface_sigibe.EdeclarationProprieteService;
|
||||||
import io.gmss.fiscad.paylaods.ApiResponse;
|
import io.gmss.fiscad.paylaods.ApiResponse;
|
||||||
@@ -195,6 +196,69 @@ public class EdeclarationProprieteController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/en-attente/by-quartier-id/{quartierId}")
|
||||||
|
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
|
public ResponseEntity<?> getEdeclarationProprieteEnAttenteByQuartierId(@CurrentUser UserPrincipal currentUser, @PathVariable Long quartierId) {
|
||||||
|
try {
|
||||||
|
if(currentUser==null)
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
Long userId = currentUser.getUser().getId();
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, edeclarationProprieteService.getEdeclarationProprieteListByStatutByQuartier(userId,quartierId,StatutEdeclarationPropriete.EN_ATTENTE), "Liste des déclaration du quartier."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
|
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
|
FileStorageException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page/en-attente/by-quartier-id/{quartierId}")
|
||||||
|
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
|
public ResponseEntity<?> getEdeclarationProprieteEnAttenteByQuartierIdPaged(@CurrentUser UserPrincipal currentUser,@PathVariable Long quartierId,@RequestParam int pageNo, @RequestParam int pageSize) {
|
||||||
|
try {
|
||||||
|
Pageable pageable = PageRequest.of(pageNo, pageSize);
|
||||||
|
if(currentUser==null)
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true,null, "Vous ne pouvez pas accéder à cette ressource"),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
Long userId = currentUser.getUser().getId();
|
||||||
|
return new ResponseEntity<>(
|
||||||
|
new ApiResponse<>(true, edeclarationProprieteService.getEdeclarationProprieteListByStatutByQuartierPageable(userId,quartierId, StatutEdeclarationPropriete.EN_ATTENTE,pageable), "Liste des déclaration du quartier."),
|
||||||
|
HttpStatus.OK
|
||||||
|
);
|
||||||
|
} catch (HttpClientErrorException.MethodNotAllowed e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Method POST/GET is required."), HttpStatus.OK);
|
||||||
|
} catch (NotFoundException | BadRequestException | MyFileNotFoundException | ResourceNotFoundException |
|
||||||
|
FileStorageException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, e.getMessage()), HttpStatus.OK);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "Null value has been detected {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage());
|
||||||
|
return new ResponseEntity<>(new ApiResponse(false, null, "An error has been occur and the content is {" + e.getMessage() + "}."), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/by-personne-id/{personneId}")
|
@GetMapping("/by-personne-id/{personneId}")
|
||||||
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
//@PreAuthorize("hasAuthority('READ_CARACTERISTIQUEBATIMENT')")
|
||||||
public ResponseEntity<?> getEdeclarationProprieteByPersonneId(@CurrentUser UserPrincipal currentUser, @PathVariable Long personneId) {
|
public ResponseEntity<?> getEdeclarationProprieteByPersonneId(@CurrentUser UserPrincipal currentUser, @PathVariable Long personneId) {
|
||||||
|
|||||||
@@ -106,4 +106,16 @@ public class EdeclarationProprieteServiceImpl implements EdeclarationProprieteSe
|
|||||||
return edeclarationProprieteRepository.findAllPayloadByQuartierId(quartierId,secteurIds);
|
return edeclarationProprieteRepository.findAllPayloadByQuartierId(quartierId,secteurIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByStatutByQuartierPageable(Long userId, Long quartierId, StatutEdeclarationPropriete statutEdeclarationPropriete, Pageable pageable) {
|
||||||
|
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||||
|
return edeclarationProprieteRepository.findAllPayloadByStatutByQuartierIdPageable(quartierId,statutEdeclarationPropriete,secteurIds,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByStatutByQuartier(Long userId, Long quartierId, StatutEdeclarationPropriete statutEdeclarationPropriete) {
|
||||||
|
List<Long> secteurIds = parcelleService.getSecteurIdListForUser(userId);
|
||||||
|
return edeclarationProprieteRepository.findAllPayloadByStatutByQuartierId(quartierId,statutEdeclarationPropriete,secteurIds);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,4 +32,9 @@ public interface EdeclarationProprieteService {
|
|||||||
Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartierPageable(Long userId,Long quartierId, Pageable pageable);
|
Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartierPageable(Long userId,Long quartierId, Pageable pageable);
|
||||||
|
|
||||||
List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartier(Long userId,Long quartierId);
|
List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByQuartier(Long userId,Long quartierId);
|
||||||
|
|
||||||
|
Page<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByStatutByQuartierPageable(Long userId,Long quartierId, StatutEdeclarationPropriete statutEdeclarationPropriete, Pageable pageable);
|
||||||
|
|
||||||
|
List<EdeclarationProprietePayloadWeb> getEdeclarationProprieteListByStatutByQuartier(Long userId,Long quartierId, StatutEdeclarationPropriete statutEdeclarationPropriete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,135 @@
|
|||||||
|
CREATE OR REPLACE PROCEDURE integrer_avis_contribuable_depuis_sigibe()
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_conn TEXT;
|
||||||
|
v_nb_importe INTEGER;
|
||||||
|
v_ids TEXT;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_conn := get_dblink_connection();
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
-- Chargement des données distantes
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
CREATE TEMP TABLE tmp_avis_contribuable
|
||||||
|
ON COMMIT DROP
|
||||||
|
AS
|
||||||
|
SELECT *
|
||||||
|
FROM dblink
|
||||||
|
(
|
||||||
|
v_conn,
|
||||||
|
'
|
||||||
|
SELECT
|
||||||
|
date_information,
|
||||||
|
id_avis_contribuable,
|
||||||
|
id_avis,
|
||||||
|
id_contribuable_foncier,
|
||||||
|
ifu,
|
||||||
|
statut
|
||||||
|
FROM e_avis_contribuable
|
||||||
|
WHERE COALESCE(integre,0)=0
|
||||||
|
'
|
||||||
|
)
|
||||||
|
AS src
|
||||||
|
(
|
||||||
|
date_information DATE,
|
||||||
|
id_avis_contribuable BIGINT,
|
||||||
|
id_avis BIGINT,
|
||||||
|
id_contribuable_foncier BIGINT,
|
||||||
|
ifu VARCHAR,
|
||||||
|
statut VARCHAR
|
||||||
|
);
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
-- Table temporaire des identifiants réellement insérés
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
CREATE TEMP TABLE tmp_ids_importes
|
||||||
|
(
|
||||||
|
id BIGINT
|
||||||
|
) ON COMMIT DROP;
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
-- Insertion + récupération des identifiants insérés
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
WITH inserted AS
|
||||||
|
(
|
||||||
|
INSERT INTO eavis_contribuable
|
||||||
|
(
|
||||||
|
created_at,
|
||||||
|
created_by,
|
||||||
|
deleted,
|
||||||
|
source,
|
||||||
|
updated_at,
|
||||||
|
updated_by,
|
||||||
|
date_information,
|
||||||
|
id_avis,
|
||||||
|
id_contribuable_foncier,
|
||||||
|
ifu,
|
||||||
|
statut,
|
||||||
|
id_avis_contribuable
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
now(),
|
||||||
|
NULL,
|
||||||
|
false,
|
||||||
|
'SIGIBE',
|
||||||
|
now(),
|
||||||
|
NULL,
|
||||||
|
t.date_information,
|
||||||
|
t.id_avis,
|
||||||
|
t.id_contribuable_foncier,
|
||||||
|
t.ifu,
|
||||||
|
t.statut,
|
||||||
|
t.id_avis_contribuable
|
||||||
|
FROM tmp_avis_contribuable t
|
||||||
|
WHERE NOT EXISTS
|
||||||
|
(
|
||||||
|
SELECT 1
|
||||||
|
FROM eavis_contribuable d
|
||||||
|
WHERE d.id_avis_contribuable = t.id_avis_contribuable
|
||||||
|
AND d.source = 'SIGIBE'
|
||||||
|
)
|
||||||
|
RETURNING id_avis_contribuable
|
||||||
|
)
|
||||||
|
INSERT INTO tmp_ids_importes(id)
|
||||||
|
SELECT id_avis_contribuable
|
||||||
|
FROM inserted;
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
-- Nombre réellement importé
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
SELECT COUNT(*)
|
||||||
|
INTO v_nb_importe
|
||||||
|
FROM tmp_ids_importes;
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
-- Construction de la liste des identifiants
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
SELECT string_agg(id::text, ',')
|
||||||
|
INTO v_ids
|
||||||
|
FROM tmp_ids_importes;
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
-- Mise à jour de la base distante
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
IF v_ids IS NOT NULL THEN
|
||||||
|
|
||||||
|
PERFORM dblink_exec
|
||||||
|
(
|
||||||
|
v_conn,
|
||||||
|
format(
|
||||||
|
'UPDATE e_avis_contribuable
|
||||||
|
SET integre = 1
|
||||||
|
WHERE id_avis_contribuable IN (%s)',
|
||||||
|
v_ids
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
RAISE NOTICE '% enregistrement(s) importé(s).', v_nb_importe;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
@@ -11,12 +11,9 @@ BEGIN
|
|||||||
created_at,
|
created_at,
|
||||||
created_by,
|
created_by,
|
||||||
deleted,
|
deleted,
|
||||||
enquete_external_key,
|
|
||||||
external_key,
|
|
||||||
source,
|
source,
|
||||||
updated_at,
|
updated_at,
|
||||||
updated_by,
|
updated_by,
|
||||||
|
|
||||||
bati,
|
bati,
|
||||||
commentaire,
|
commentaire,
|
||||||
date_construction,
|
date_construction,
|
||||||
@@ -41,7 +38,6 @@ BEGIN
|
|||||||
superficie_sol_ulo,
|
superficie_sol_ulo,
|
||||||
usage,
|
usage,
|
||||||
valeur_batiment,
|
valeur_batiment,
|
||||||
|
|
||||||
personne_id,
|
personne_id,
|
||||||
quartier_id,
|
quartier_id,
|
||||||
statut_edeclaration_propriete
|
statut_edeclaration_propriete
|
||||||
@@ -50,12 +46,9 @@ BEGIN
|
|||||||
now() AS created_at,
|
now() AS created_at,
|
||||||
NULL::bigint AS created_by,
|
NULL::bigint AS created_by,
|
||||||
false AS deleted,
|
false AS deleted,
|
||||||
NULL::bigint AS enquete_external_key,
|
|
||||||
NULL::bigint AS external_key,
|
|
||||||
'SIGIBE' AS source,
|
'SIGIBE' AS source,
|
||||||
NULL::timestamp with time zone AS updated_at,
|
NULL::timestamp with time zone AS updated_at,
|
||||||
NULL::bigint AS updated_by,
|
NULL::bigint AS updated_by,
|
||||||
|
|
||||||
src.bati,
|
src.bati,
|
||||||
src.commentaire,
|
src.commentaire,
|
||||||
src.date_construction,
|
src.date_construction,
|
||||||
@@ -80,12 +73,11 @@ BEGIN
|
|||||||
src.superficie_sol_ulo,
|
src.superficie_sol_ulo,
|
||||||
src.usage,
|
src.usage,
|
||||||
src.valeur_batiment,
|
src.valeur_batiment,
|
||||||
|
|
||||||
p.id AS personne_id,
|
p.id AS personne_id,
|
||||||
q.id AS quartier_id,
|
q.id AS quartier_id,
|
||||||
'EN_ATTENTE'
|
'EN_ATTENTE'
|
||||||
FROM dblink(
|
FROM dblink(
|
||||||
'host=localhost port=5432 dbname=sigibe_test user=sigibe_test_user password=1234567890',
|
get_dblink_connection(),
|
||||||
'
|
'
|
||||||
SELECT
|
SELECT
|
||||||
bati,
|
bati,
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
CREATE OR REPLACE PROCEDURE public.integrer_epaiement_acompte_depuis_sigibe()
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_nb_importe INTEGER;
|
||||||
|
v_conn TEXT;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_conn := get_dblink_connection();
|
||||||
|
|
||||||
|
INSERT INTO public.epaiement_acompte
|
||||||
|
(
|
||||||
|
created_at,
|
||||||
|
created_by,
|
||||||
|
deleted,
|
||||||
|
enquete_external_key,
|
||||||
|
external_key,
|
||||||
|
source,
|
||||||
|
updated_at,
|
||||||
|
updated_by,
|
||||||
|
date_avis_credit,
|
||||||
|
date_information,
|
||||||
|
date_rapprochement,
|
||||||
|
date_validation,
|
||||||
|
id_exercice,
|
||||||
|
id_impot_nature,
|
||||||
|
id_impot_type,
|
||||||
|
id_paiement_acompte,
|
||||||
|
id_paiement_impot,
|
||||||
|
ifu,
|
||||||
|
montant_paye,
|
||||||
|
nup,
|
||||||
|
qip_ilot,
|
||||||
|
qip_parcelle,
|
||||||
|
qip_quartier,
|
||||||
|
r_commune,
|
||||||
|
r_doc,
|
||||||
|
r_impot,
|
||||||
|
r_quartier,
|
||||||
|
exercice,
|
||||||
|
montant_payer
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
now(),
|
||||||
|
NULL,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
src.id_paiement_acompte,
|
||||||
|
'SIGIBE',
|
||||||
|
now(),
|
||||||
|
NULL,
|
||||||
|
src.date_avis_credit,
|
||||||
|
src.date_information,
|
||||||
|
src.date_rapprochement,
|
||||||
|
src.date_validation,
|
||||||
|
src.id_exercice,
|
||||||
|
src.id_impot_nature,
|
||||||
|
src.id_impot_type,
|
||||||
|
src.id_paiement_acompte,
|
||||||
|
src.id_paiement_impot,
|
||||||
|
src.ifu,
|
||||||
|
src.montant_paye,
|
||||||
|
src.nup,
|
||||||
|
src.qip_ilot,
|
||||||
|
src.qip_parcelle,
|
||||||
|
src.qip_quartier,
|
||||||
|
src.r_commune,
|
||||||
|
src.r_doc,
|
||||||
|
src.r_impot,
|
||||||
|
src.r_quartier,
|
||||||
|
src.id_exercice,
|
||||||
|
src.montant_paye
|
||||||
|
FROM dblink(
|
||||||
|
v_conn,
|
||||||
|
'
|
||||||
|
SELECT
|
||||||
|
date_avis_credit,
|
||||||
|
date_information,
|
||||||
|
date_rapprochement,
|
||||||
|
date_validation,
|
||||||
|
id_exercice,
|
||||||
|
id_impot_nature,
|
||||||
|
id_impot_type,
|
||||||
|
id_paiement_acompte,
|
||||||
|
id_paiement_impot,
|
||||||
|
ifu,
|
||||||
|
montant_paye,
|
||||||
|
nup,
|
||||||
|
qip_ilot,
|
||||||
|
qip_parcelle,
|
||||||
|
qip_quartier,
|
||||||
|
r_commune,
|
||||||
|
r_doc,
|
||||||
|
r_impot,
|
||||||
|
r_quartier
|
||||||
|
FROM public.e_paiement_acompte
|
||||||
|
'
|
||||||
|
) AS src
|
||||||
|
(
|
||||||
|
date_avis_credit DATE,
|
||||||
|
date_information DATE,
|
||||||
|
date_rapprochement DATE,
|
||||||
|
date_validation DATE,
|
||||||
|
id_exercice BIGINT,
|
||||||
|
id_impot_nature VARCHAR,
|
||||||
|
id_impot_type VARCHAR,
|
||||||
|
id_paiement_acompte BIGINT,
|
||||||
|
id_paiement_impot BIGINT,
|
||||||
|
ifu VARCHAR,
|
||||||
|
montant_paye BIGINT,
|
||||||
|
nup VARCHAR,
|
||||||
|
qip_ilot VARCHAR,
|
||||||
|
qip_parcelle VARCHAR,
|
||||||
|
qip_quartier VARCHAR,
|
||||||
|
r_commune VARCHAR,
|
||||||
|
r_doc VARCHAR,
|
||||||
|
r_impot VARCHAR,
|
||||||
|
r_quartier VARCHAR
|
||||||
|
)
|
||||||
|
WHERE NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM epaiement_acompte d
|
||||||
|
WHERE d.id_paiement_acompte = src.id_paiement_acompte
|
||||||
|
);
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_nb_importe = ROW_COUNT;
|
||||||
|
|
||||||
|
RAISE NOTICE '% enregistrement(s) importé(s) dans epaiement_acompte.', v_nb_importe;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
CREATE OR REPLACE PROCEDURE public.integrer_epaiement_avis_depuis_sigibe()
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_conn TEXT;
|
||||||
|
v_nb_importe INTEGER;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_conn := get_dblink_connection();
|
||||||
|
|
||||||
|
INSERT INTO public.epaiement_avis
|
||||||
|
(
|
||||||
|
created_at,
|
||||||
|
created_by,
|
||||||
|
deleted,
|
||||||
|
enquete_external_key,
|
||||||
|
external_key,
|
||||||
|
source,
|
||||||
|
updated_at,
|
||||||
|
updated_by,
|
||||||
|
date_avis_credit,
|
||||||
|
date_information,
|
||||||
|
date_rapprochement,
|
||||||
|
date_validation,
|
||||||
|
id_avis,
|
||||||
|
id_contribuable_foncier,
|
||||||
|
id_impot_nature,
|
||||||
|
id_impot_type,
|
||||||
|
id_paiement_impot,
|
||||||
|
id_unite_foncier,
|
||||||
|
ifu,
|
||||||
|
montant_payer,
|
||||||
|
r_commune,
|
||||||
|
r_doc,
|
||||||
|
r_impot,
|
||||||
|
nup,
|
||||||
|
qip_ilot,
|
||||||
|
qip_parcelle,
|
||||||
|
qip_quartier,
|
||||||
|
r_quartier
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
now(),
|
||||||
|
NULL,
|
||||||
|
false,
|
||||||
|
NULL,
|
||||||
|
src.id_paiement_impot,
|
||||||
|
'SIGIBE',
|
||||||
|
now(),
|
||||||
|
NULL,
|
||||||
|
src.date_avis_credit,
|
||||||
|
src.date_information,
|
||||||
|
src.date_rapprochement,
|
||||||
|
src.date_validation,
|
||||||
|
src.id_avis,
|
||||||
|
src.id_contribuable_foncier,
|
||||||
|
src.id_impot_nature,
|
||||||
|
src.id_impot_type,
|
||||||
|
src.id_paiement_impot,
|
||||||
|
src.id_unite_foncier,
|
||||||
|
src.ifu,
|
||||||
|
src.montant_paye,
|
||||||
|
src.r_commune,
|
||||||
|
src.r_doc,
|
||||||
|
src.r_impot,
|
||||||
|
src.nup,
|
||||||
|
src.qip_ilot,
|
||||||
|
src.qip_parcelle,
|
||||||
|
src.qip_quartier,
|
||||||
|
src.r_quartier
|
||||||
|
FROM dblink
|
||||||
|
(
|
||||||
|
v_conn,
|
||||||
|
'
|
||||||
|
SELECT
|
||||||
|
date_avis_credit,
|
||||||
|
date_information,
|
||||||
|
date_rapprochement,
|
||||||
|
date_validation,
|
||||||
|
id_avis,
|
||||||
|
id_contribuable_foncier,
|
||||||
|
id_impot_nature,
|
||||||
|
id_impot_type,
|
||||||
|
id_paiement_impot,
|
||||||
|
id_unite_foncier,
|
||||||
|
ifu,
|
||||||
|
montant_paye,
|
||||||
|
r_commune,
|
||||||
|
r_doc,
|
||||||
|
r_impot,
|
||||||
|
nup,
|
||||||
|
qip_ilot,
|
||||||
|
qip_parcelle,
|
||||||
|
qip_quartier,
|
||||||
|
r_quartier
|
||||||
|
FROM public.e_paiement_avis
|
||||||
|
'
|
||||||
|
)
|
||||||
|
AS src
|
||||||
|
(
|
||||||
|
date_avis_credit DATE,
|
||||||
|
date_information DATE,
|
||||||
|
date_rapprochement DATE,
|
||||||
|
date_validation DATE,
|
||||||
|
id_avis BIGINT,
|
||||||
|
id_contribuable_foncier BIGINT,
|
||||||
|
id_impot_nature VARCHAR,
|
||||||
|
id_impot_type VARCHAR,
|
||||||
|
id_paiement_impot BIGINT,
|
||||||
|
id_unite_foncier BIGINT,
|
||||||
|
ifu VARCHAR,
|
||||||
|
montant_paye BIGINT,
|
||||||
|
r_commune VARCHAR,
|
||||||
|
r_doc VARCHAR,
|
||||||
|
r_impot VARCHAR,
|
||||||
|
nup VARCHAR,
|
||||||
|
qip_ilot VARCHAR,
|
||||||
|
qip_parcelle VARCHAR,
|
||||||
|
qip_quartier VARCHAR,
|
||||||
|
r_quartier VARCHAR
|
||||||
|
)
|
||||||
|
WHERE NOT EXISTS
|
||||||
|
(
|
||||||
|
SELECT 1
|
||||||
|
FROM public.epaiement_avis d
|
||||||
|
WHERE d.id_paiement_impot = src.id_paiement_impot
|
||||||
|
);
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_nb_importe = ROW_COUNT;
|
||||||
|
|
||||||
|
RAISE NOTICE '% enregistrement(s) importé(s) dans epaiement_avis.', v_nb_importe;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
CREATE OR REPLACE PROCEDURE public.integrer_epaiement_retenue_depuis_sigibe()
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
DECLARE
|
||||||
|
v_conn TEXT;
|
||||||
|
v_nb_importe INTEGER;
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
v_conn := get_dblink_connection();
|
||||||
|
|
||||||
|
INSERT INTO public.epaiement_retenue
|
||||||
|
(
|
||||||
|
date_avis_credit,
|
||||||
|
date_information,
|
||||||
|
date_rapprochement,
|
||||||
|
date_validation,
|
||||||
|
id_exercice,
|
||||||
|
id_edi_generique,
|
||||||
|
id_impot_nature,
|
||||||
|
id_impot_type,
|
||||||
|
id_paiement_impot,
|
||||||
|
id_paiement_retenue,
|
||||||
|
ifu_payeur,
|
||||||
|
ifu_retenue,
|
||||||
|
montant_paye,
|
||||||
|
nup,
|
||||||
|
qip_ilot,
|
||||||
|
qip_parcelle,
|
||||||
|
qip_quartier,
|
||||||
|
r_commune,
|
||||||
|
r_doc,
|
||||||
|
r_impot,
|
||||||
|
r_quartier
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
src.date_avis_credit,
|
||||||
|
src.date_information,
|
||||||
|
src.date_rapprochement,
|
||||||
|
src.date_validation,
|
||||||
|
src.id_exercice,
|
||||||
|
src.id_edi_generique,
|
||||||
|
src.id_impot_nature,
|
||||||
|
src.id_impot_type,
|
||||||
|
src.id_paiement_impot,
|
||||||
|
src.id_paiement_retenue,
|
||||||
|
src.ifu_payeur,
|
||||||
|
src.ifu_retenue,
|
||||||
|
src.montant_paye,
|
||||||
|
src.nup,
|
||||||
|
src.qip_ilot,
|
||||||
|
src.qip_parcelle,
|
||||||
|
src.qip_quartier,
|
||||||
|
src.r_commune,
|
||||||
|
src.r_doc,
|
||||||
|
src.r_impot,
|
||||||
|
src.r_quartier
|
||||||
|
FROM dblink
|
||||||
|
(
|
||||||
|
v_conn,
|
||||||
|
'
|
||||||
|
SELECT
|
||||||
|
date_avis_credit,
|
||||||
|
date_information,
|
||||||
|
date_rapprochement,
|
||||||
|
date_validation,
|
||||||
|
id_exercice,
|
||||||
|
id_edi_generique,
|
||||||
|
id_impot_nature,
|
||||||
|
id_impot_type,
|
||||||
|
id_paiement_impot,
|
||||||
|
id_paiement_retenue,
|
||||||
|
ifu_payeur,
|
||||||
|
ifu_retenue,
|
||||||
|
montant_paye,
|
||||||
|
nup,
|
||||||
|
qip_ilot,
|
||||||
|
qip_parcelle,
|
||||||
|
qip_quartier,
|
||||||
|
r_commune,
|
||||||
|
r_doc,
|
||||||
|
r_impot,
|
||||||
|
r_quartier
|
||||||
|
FROM public.e_paiement_retenue
|
||||||
|
'
|
||||||
|
)
|
||||||
|
AS src
|
||||||
|
(
|
||||||
|
date_avis_credit DATE,
|
||||||
|
date_information DATE,
|
||||||
|
date_rapprochement DATE,
|
||||||
|
date_validation DATE,
|
||||||
|
id_exercice BIGINT,
|
||||||
|
id_edi_generique BIGINT,
|
||||||
|
id_impot_nature VARCHAR,
|
||||||
|
id_impot_type VARCHAR,
|
||||||
|
id_paiement_impot BIGINT,
|
||||||
|
id_paiement_retenue BIGINT,
|
||||||
|
ifu_payeur VARCHAR,
|
||||||
|
ifu_retenue VARCHAR,
|
||||||
|
montant_paye BIGINT,
|
||||||
|
nup VARCHAR,
|
||||||
|
qip_ilot VARCHAR,
|
||||||
|
qip_parcelle VARCHAR,
|
||||||
|
qip_quartier VARCHAR,
|
||||||
|
r_commune VARCHAR,
|
||||||
|
r_doc VARCHAR,
|
||||||
|
r_impot VARCHAR,
|
||||||
|
r_quartier VARCHAR
|
||||||
|
)
|
||||||
|
WHERE NOT EXISTS
|
||||||
|
(
|
||||||
|
SELECT 1
|
||||||
|
FROM public.epaiement_retenue d
|
||||||
|
WHERE d.id_paiement_retenue = src.id_paiement_retenue
|
||||||
|
);
|
||||||
|
|
||||||
|
GET DIAGNOSTICS v_nb_importe = ROW_COUNT;
|
||||||
|
|
||||||
|
RAISE NOTICE '% enregistrement(s) importé(s) dans epaiement_retenue.', v_nb_importe;
|
||||||
|
|
||||||
|
END;
|
||||||
|
$$;
|
||||||
@@ -2,6 +2,7 @@ package io.gmss.fiscad.persistence.repositories.interface_sigibe;
|
|||||||
|
|
||||||
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
import io.gmss.fiscad.entities.interface_sigibe.EdeclarationPropriete;
|
||||||
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
import io.gmss.fiscad.entities.rfu.metier.CaracteristiqueBatiment;
|
||||||
|
import io.gmss.fiscad.enums.StatutEdeclarationPropriete;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueBatimentPayloadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.CaracteristiqueBatimentPayloadWeb;
|
||||||
import io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb;
|
import io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb;
|
||||||
import io.gmss.fiscad.paylaods.response.restoration.CaracateristiqueBatimentPayLoadsRestor;
|
import io.gmss.fiscad.paylaods.response.restoration.CaracateristiqueBatimentPayLoadsRestor;
|
||||||
@@ -367,6 +368,54 @@ public interface EdeclarationProprieteRepository extends JpaRepository<Edeclarat
|
|||||||
List<EdeclarationProprietePayloadWeb> findAllPayloadByQuartierId(@Param("quartierId") Long quartierId,
|
List<EdeclarationProprietePayloadWeb> findAllPayloadByQuartierId(@Param("quartierId") Long quartierId,
|
||||||
@Param("secteurIds") List<Long> secteurIds);
|
@Param("secteurIds") List<Long> secteurIds);
|
||||||
|
|
||||||
|
|
||||||
|
@Query("""
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||||
|
e.id,
|
||||||
|
e.idImpot,
|
||||||
|
e.rImpot,
|
||||||
|
e.ifu,
|
||||||
|
e.rCommune,
|
||||||
|
e.rQuartier,
|
||||||
|
e.qipQuartier,
|
||||||
|
e.qipIlot,
|
||||||
|
e.qipParcelle,
|
||||||
|
e.nup,
|
||||||
|
e.gpsLatitude,
|
||||||
|
e.gpsLongitude,
|
||||||
|
e.commentaire,
|
||||||
|
e.dateValidation,
|
||||||
|
e.dateInformation,
|
||||||
|
e.valeurBatiment,
|
||||||
|
e.nub,
|
||||||
|
e.nul,
|
||||||
|
e.montantLocatifAnnuel,
|
||||||
|
e.dateConstruction,
|
||||||
|
e.superficieSolBat,
|
||||||
|
e.superficieSolUlo,
|
||||||
|
e.superficieParcelle,
|
||||||
|
e.usage,
|
||||||
|
e.bati,
|
||||||
|
p.id,
|
||||||
|
p.nom,
|
||||||
|
p.prenom,
|
||||||
|
p.raisonSociale,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
e.statutEdeclarationPropriete
|
||||||
|
)
|
||||||
|
FROM EdeclarationPropriete e
|
||||||
|
LEFT JOIN e.personne p
|
||||||
|
LEFT JOIN e.quartier q
|
||||||
|
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||||
|
WHERE q.id = :quartierId
|
||||||
|
AND sd.secteur.id IN (:secteurIds)
|
||||||
|
AND e.statutEdeclarationPropriete = :statutDeclarationProprieteParam
|
||||||
|
""")
|
||||||
|
List<EdeclarationProprietePayloadWeb> findAllPayloadByStatutByQuartierId(@Param("quartierId") Long quartierId,
|
||||||
|
@Param("statutDeclarationProprieteParam") StatutEdeclarationPropriete statutDeclarationProprieteParam,
|
||||||
|
@Param("secteurIds") List<Long> secteurIds);
|
||||||
@Query(value = """
|
@Query(value = """
|
||||||
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||||
e.id,
|
e.id,
|
||||||
@@ -424,6 +473,66 @@ public interface EdeclarationProprieteRepository extends JpaRepository<Edeclarat
|
|||||||
@Param("secteurIds") List<Long> secteurIds,
|
@Param("secteurIds") List<Long> secteurIds,
|
||||||
Pageable pageable);
|
Pageable pageable);
|
||||||
|
|
||||||
|
@Query(value = """
|
||||||
|
SELECT new io.gmss.fiscad.paylaods.request.crudweb.EdeclarationProprietePayloadWeb(
|
||||||
|
e.id,
|
||||||
|
e.idImpot,
|
||||||
|
e.rImpot,
|
||||||
|
e.ifu,
|
||||||
|
e.rCommune,
|
||||||
|
e.rQuartier,
|
||||||
|
e.qipQuartier,
|
||||||
|
e.qipIlot,
|
||||||
|
e.qipParcelle,
|
||||||
|
e.nup,
|
||||||
|
e.gpsLatitude,
|
||||||
|
e.gpsLongitude,
|
||||||
|
e.commentaire,
|
||||||
|
e.dateValidation,
|
||||||
|
e.dateInformation,
|
||||||
|
e.valeurBatiment,
|
||||||
|
e.nub,
|
||||||
|
e.nul,
|
||||||
|
e.montantLocatifAnnuel,
|
||||||
|
e.dateConstruction,
|
||||||
|
e.superficieSolBat,
|
||||||
|
e.superficieSolUlo,
|
||||||
|
e.superficieParcelle,
|
||||||
|
e.usage,
|
||||||
|
e.bati,
|
||||||
|
p.id,
|
||||||
|
p.nom,
|
||||||
|
p.prenom,
|
||||||
|
p.raisonSociale,
|
||||||
|
q.id,
|
||||||
|
q.code,
|
||||||
|
q.nom,
|
||||||
|
e.statutEdeclarationPropriete
|
||||||
|
)
|
||||||
|
FROM EdeclarationPropriete e
|
||||||
|
LEFT JOIN e.personne p
|
||||||
|
LEFT JOIN e.quartier q
|
||||||
|
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||||
|
WHERE q.id = :quartierId
|
||||||
|
AND sd.secteur.id IN (:secteurIds)
|
||||||
|
AND e.statutEdeclarationPropriete = :statutDeclarationProprieteParam
|
||||||
|
""",
|
||||||
|
countQuery = """
|
||||||
|
SELECT COUNT(e)
|
||||||
|
FROM EdeclarationPropriete e
|
||||||
|
LEFT JOIN e.personne p
|
||||||
|
LEFT JOIN e.quartier q
|
||||||
|
INNER JOIN SecteurDecoupage sd on sd.quartier=q
|
||||||
|
WHERE q.id = :quartierId
|
||||||
|
AND sd.secteur.id IN (:secteurIds)
|
||||||
|
AND e.statutEdeclarationPropriete = :statutDeclarationProprieteParam
|
||||||
|
""")
|
||||||
|
Page<EdeclarationProprietePayloadWeb> findAllPayloadByStatutByQuartierIdPageable(
|
||||||
|
@Param("quartierId") Long quartierId,
|
||||||
|
@Param("statutDeclarationProprieteParam") StatutEdeclarationPropriete statutDeclarationProprieteParam,
|
||||||
|
@Param("secteurIds") List<Long> secteurIds,
|
||||||
|
Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Query(
|
@Query(
|
||||||
|
|||||||
@@ -1089,6 +1089,7 @@ public class EntityFromPayLoadService {
|
|||||||
fonctionnalite.setCode(fonctionnalitePayloadWeb.getCode());
|
fonctionnalite.setCode(fonctionnalitePayloadWeb.getCode());
|
||||||
fonctionnalite.setNom(fonctionnalitePayloadWeb.getNom());
|
fonctionnalite.setNom(fonctionnalitePayloadWeb.getNom());
|
||||||
fonctionnalite.setActif(fonctionnalitePayloadWeb.getActif());
|
fonctionnalite.setActif(fonctionnalitePayloadWeb.getActif());
|
||||||
|
fonctionnalite.setLien(fonctionnalitePayloadWeb.getLien());
|
||||||
return fonctionnalite ;
|
return fonctionnalite ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user