Commit aac3b1c3 authored by Laurent Lécluse's avatar Laurent Lécluse
Browse files

Travaux en cours

parent 5a5e2055
......@@ -10,7 +10,6 @@ return [
'TYPE_AGREMENT_ID',
'INTERVENANT_ID',
'STRUCTURE_ID',
'TO_DELETE',
'ANNEE_AGREMENT',
],
];
......
......@@ -3,7 +3,7 @@
//@formatter:off
return [
'name' => 'TBL_CHARGENS_SEUILS_DEF__UN',
'name' => 'TBL_CHARGENS_SEUILS_DEF_UN',
'unique' => TRUE,
'table' => 'TBL_CHARGENS_SEUILS_DEF',
'columns' => [
......
......@@ -3,7 +3,7 @@
//@formatter:off
return [
'name' => 'TBL_CHARGENS__UN',
'name' => 'TBL_CHARGENS_UN',
'unique' => TRUE,
'table' => 'TBL_CHARGENS',
'columns' => [
......
<?php
//@formatter:off
return [
'name' => 'TBL_CLOTURE_REALISE_UN',
'unique' => TRUE,
'table' => 'TBL_CLOTURE_REALISE',
'columns' => [
'INTERVENANT_ID',
'TO_DELETE',
],
];
//@formatter:on
......@@ -9,7 +9,6 @@ return [
'columns' => [
'INTERVENANT_ID',
'STRUCTURE_ID',
'TO_DELETE',
],
];
......
......@@ -10,7 +10,6 @@ return [
'ANNEE_ID',
'TYPE_RESSOURCE_ID',
'STRUCTURE_ID',
'TO_DELETE',
],
];
......
<?php
//@formatter:off
return [
'name' => 'TBL_DOSSIER_UN',
'unique' => TRUE,
'table' => 'TBL_DOSSIER',
'columns' => [
'INTERVENANT_ID',
'TO_DELETE',
],
];
//@formatter:on
......@@ -8,7 +8,6 @@ return [
'table' => 'TBL_PAIEMENT',
'columns' => [
'INTERVENANT_ID',
'TO_DELETE',
'MISE_EN_PAIEMENT_ID',
'FORMULE_RES_SERVICE_ID',
'FORMULE_RES_SERVICE_REF_ID',
......
......@@ -3,13 +3,12 @@
//@formatter:off
return [
'name' => 'TBL_PJD_UN',
'name' => 'TBL_PIECE_JOINTE_DEMANDE_UN',
'unique' => TRUE,
'table' => 'TBL_PIECE_JOINTE_DEMANDE',
'columns' => [
'TYPE_PIECE_JOINTE_ID',
'INTERVENANT_ID',
'TO_DELETE',
],
];
......
......@@ -3,7 +3,7 @@
//@formatter:off
return [
'name' => 'TBL_PJF_UN',
'name' => 'TBL_PIECE_JOINTE_FOURNIE_UN',
'unique' => TRUE,
'table' => 'TBL_PIECE_JOINTE_FOURNIE',
'columns' => [
......
......@@ -3,13 +3,12 @@
//@formatter:off
return [
'name' => 'TBL_PIECE_JOINTE__UN',
'name' => 'TBL_PIECE_JOINTE_UN',
'unique' => TRUE,
'table' => 'TBL_PIECE_JOINTE',
'columns' => [
'TYPE_PIECE_JOINTE_ID',
'INTERVENANT_ID',
'TO_DELETE',
],
];
......
......@@ -10,7 +10,6 @@ return [
'INTERVENANT_ID',
'TYPE_VOLUME_HORAIRE_ID',
'STRUCTURE_ID',
'TO_DELETE',
],
];
......
<?php
//@formatter:off
return [
'name' => 'TBL_SERVICE_SAISIE_UN',
'unique' => TRUE,
'table' => 'TBL_SERVICE_SAISIE',
'columns' => [
'INTERVENANT_ID',
'TO_DELETE',
],
];
//@formatter:on
......@@ -9,7 +9,6 @@ return [
'columns' => [
'SERVICE_ID',
'TYPE_VOLUME_HORAIRE_ID',
'TO_DELETE',
],
];
......
......@@ -13,7 +13,6 @@ return [
'SERVICE_ID',
'VOLUME_HORAIRE_ID',
'VALIDATION_ID',
'TO_DELETE',
],
];
......
......@@ -3,7 +3,7 @@
//@formatter:off
return [
'name' => 'TBL_VALIDATION_REFERENTIEL__UN',
'name' => 'TBL_VALIDATION_REFERENTIEL_UN',
'unique' => TRUE,
'table' => 'TBL_VALIDATION_REFERENTIEL',
'columns' => [
......@@ -13,7 +13,6 @@ return [
'SERVICE_REFERENTIEL_ID',
'VOLUME_HORAIRE_REF_ID',
'VALIDATION_ID',
'TO_DELETE',
],
];
......
......@@ -12,8 +12,7 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
FROM tbl
WHERE tbl_name <> 'formule' -- TROP LONG !!
ORDER BY ordre
)
LOOP
)LOOP
UNICAEN_TBL.CALCULER(d.tbl_name);
dbms_output.put_line('Calcul du tableau de bord "' || d.tbl_name || '" effectué');
COMMIT;
......@@ -22,6 +21,20 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
PROCEDURE CALCUL_FEUILLE_DE_ROUTE( INTERVENANT_ID NUMERIC ) IS
BEGIN
FOR d IN (
SELECT tbl_name
FROM tbl
WHERE feuille_de_route = 1
ORDER BY ordre
) LOOP
UNICAEN_TBL.CALCULER(d.tbl_name,'INTERVENANT_ID',intervenant_id);
END LOOP;
END;
FUNCTION GET_OSE_UTILISATEUR_ID RETURN NUMERIC IS
BEGIN
IF OSE_DIVERS.OSE_UTILISATEUR_ID IS NULL THEN
......@@ -103,20 +116,6 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
RETURN res;
END;
FUNCTION implode(i_query VARCHAR2, i_seperator VARCHAR2 DEFAULT ',') RETURN VARCHAR2 AS
l_return CLOB:='';
l_temp CLOB;
TYPE r_cursor is REF CURSOR;
rc r_cursor;
BEGIN
OPEN rc FOR i_query;
LOOP
FETCH rc INTO L_TEMP;
EXIT WHEN RC%NOTFOUND;
l_return:=l_return||L_TEMP||i_seperator;
END LOOP;
RETURN RTRIM(l_return,i_seperator);
END;
PROCEDURE intervenant_horodatage_service( INTERVENANT_ID NUMERIC, TYPE_VOLUME_HORAIRE_ID NUMERIC, REFERENTIEL NUMERIC, HISTO_MODIFICATEUR_ID NUMERIC, HISTO_MODIFICATION DATE ) AS
BEGIN
......@@ -259,13 +258,7 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
INSERT INTO SYNC_LOG( id, date_sync, message ) VALUES ( sync_log_id_seq.nextval, systimestamp, msg );
END;
FUNCTION FORMATTED_RIB (bic VARCHAR2, iban VARCHAR2) RETURN VARCHAR2 IS
BEGIN
if bic is null and iban is null then
return null;
end if;
RETURN regexp_replace(bic, '[[:space:]]+', '') || '-' || regexp_replace(iban, '[[:space:]]+', '');
END;
FUNCTION FORMATTED_ADRESSE(precisions VARCHAR2, lieu_dit VARCHAR2, numero VARCHAR2, numero_compl_id NUMERIC, voirie_id NUMERIC, voie VARCHAR2, code_postal VARCHAR2, commune VARCHAR2, pays_id VARCHAR2 ) RETURN VARCHAR2 IS
a VARCHAR2(4000) DEFAULT '';
......@@ -338,27 +331,4 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
RETURN a;
END;
PROCEDURE CALCUL_FEUILLE_DE_ROUTE( CONDS VARCHAR2 ) IS
BEGIN
FOR d IN (
SELECT tbl_name
FROM tbl
WHERE feuille_de_route = 1
ORDER BY ordre
) LOOP
UNICAEN_TBL.CALCULER(d.tbl_name,CONDS);
END LOOP;
END;
FUNCTION GET_TRIGGER_BODY( TRIGGER_NAME VARCHAR2 ) RETURN VARCHAR2 IS
vlong long;
BEGIN
SELECT trigger_body INTO vlong FROM all_triggers WHERE trigger_name = GET_TRIGGER_BODY.TRIGGER_NAME;
RETURN substr(vlong, 1, 32767);
END;
END OSE_DIVERS;
\ No newline at end of file
CREATE OR REPLACE PACKAGE "OSE_DIVERS" AS
PROCEDURE CALCULER_TABLEAUX_BORD;
PROCEDURE CALCUL_FEUILLE_DE_ROUTE( INTERVENANT_ID NUMERIC );
FUNCTION GET_OSE_UTILISATEUR_ID RETURN NUMERIC;
FUNCTION GET_OSE_SOURCE_ID RETURN NUMERIC;
FUNCTION INTERVENANT_HAS_PRIVILEGE( intervenant_id NUMERIC, privilege_name VARCHAR2 ) RETURN NUMERIC;
FUNCTION implode(i_query VARCHAR2, i_seperator VARCHAR2 DEFAULT ',') RETURN VARCHAR2;
PROCEDURE intervenant_horodatage_service( INTERVENANT_ID NUMERIC, TYPE_VOLUME_HORAIRE_ID NUMERIC, REFERENTIEL NUMERIC, HISTO_MODIFICATEUR_ID NUMERIC, HISTO_MODIFICATION DATE );
FUNCTION NIVEAU_FORMATION_ID_CALC( gtf_id NUMERIC, gtf_pertinence_niveau NUMERIC, niveau NUMERIC DEFAULT NULL ) RETURN NUMERIC;
......@@ -27,8 +26,6 @@ CREATE OR REPLACE PACKAGE "OSE_DIVERS" AS
PROCEDURE SYNC_LOG( msg VARCHAR2 );
FUNCTION FORMATTED_RIB (bic VARCHAR2, iban VARCHAR2) RETURN VARCHAR2;
FUNCTION FORMATTED_ADRESSE(
precisions VARCHAR2,
lieu_dit VARCHAR2,
......@@ -41,7 +38,4 @@ CREATE OR REPLACE PACKAGE "OSE_DIVERS" AS
pays_id VARCHAR2
) RETURN VARCHAR2;
PROCEDURE CALCUL_FEUILLE_DE_ROUTE( CONDS VARCHAR2 );
FUNCTION GET_TRIGGER_BODY( TRIGGER_NAME VARCHAR2 ) RETURN VARCHAR2;
END OSE_DIVERS;
\ No newline at end of file
CREATE OR REPLACE PACKAGE BODY "OSE_EVENT" AS
PROCEDURE ON_AFTER_FORMULE_CALC( INTERVENANT_ID NUMERIC ) IS
p unicaen_tbl.t_params;
BEGIN
p := UNICAEN_TBL.make_params('INTERVENANT_ID', ON_AFTER_FORMULE_CALC.intervenant_id);
RETURN;
END;
END OSE_EVENT;
\ No newline at end of file
......@@ -833,13 +833,13 @@ CREATE OR REPLACE PACKAGE BODY "OSE_FORMULE" AS
PROCEDURE CALCULER_TBL( PARAMS UNICAEN_TBL.T_PARAMS ) IS
PROCEDURE CALCULER_TBL(param VARCHAR2 DEFAULT NULL, value VARCHAR2 DEFAULT NULL) IS
intervenant_id NUMERIC;
TYPE r_cursor IS REF CURSOR;
diff_cur r_cursor;
BEGIN
OPEN diff_cur FOR 'WITH interv AS (SELECT id intervenant_id, intervenant.* FROM intervenant)
SELECT intervenant_id FROM interv WHERE ' || unicaen_tbl.PARAMS_TO_CONDS( params );
OPEN diff_cur FOR 'SELECT id FROM intervenant WHERE '
|| unicaen_tbl.MAKE_WHERE( CASE param WHEN 'INTERVENANT_ID' THEN 'ID' ELSE param END, value );
LOOP
FETCH diff_cur INTO intervenant_id; EXIT WHEN diff_cur%NOTFOUND;
BEGIN
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment