BLOS#79136 -- Systematiek Locatieleiders en Werkplekkoppelingen - Inpassen toewijzing autorisatiegroepen
svn path=/Customer/trunk/; revision=62350
This commit is contained in:
@@ -647,15 +647,13 @@ AS
|
||||
AND pk.prs_perslid_key IN (SELECT d.prs_perslid_key FROM blos_v_personenlijst_loc d)
|
||||
ORDER BY 1, 2 ;
|
||||
|
||||
CURSOR c_loc_del -- Voor opschonen van de locatiemanagers die geen locaties meer onder zich hebben en nog wel in autorisatiegroep
|
||||
CURSOR c_loc_recht -- -- Voor onderhouder van de locatiemanagers in de autorisatiegroepen
|
||||
IS
|
||||
SELECT p.prs_perslid_key, p.naam,
|
||||
(SELECT count(*) FROM prs_perslidwerkplek wp WHERE wp.prs_perslid_key = p.prs_perslid_key) aantal_wp,
|
||||
gg.fac_gebruikersgroep_key
|
||||
FROM blos_v_personenlijst_loc p, fac_gebruikersgroep gg
|
||||
(SELECT count(*) FROM fac_gebruikersgroep gg WHERE gg.prs_perslid_key = p.prs_perslid_key AND gg.fac_groep_key = 24) groep
|
||||
FROM blos_v_personenlijst_loc p
|
||||
WHERE p.prs_perslid_verwijder IS NULL
|
||||
AND p.prs_perslid_key = gg.prs_perslid_key
|
||||
AND gg.fac_groep_key = 24 -- autorisatiegroep Locatiemanagers
|
||||
ORDER BY 1 ;
|
||||
|
||||
|
||||
@@ -672,6 +670,8 @@ AS
|
||||
v_prs_perslidkostenplaats_key NUMBER (10);
|
||||
v_teller_mandaat NUMBER (10);
|
||||
v_upsert_sync NUMBER(1);
|
||||
c_fac_groep_key NUMBER(10) := 24 ; -- standaard autorisatiegroep voor Locatiemanagers
|
||||
|
||||
|
||||
BEGIN
|
||||
v_count := 0;
|
||||
@@ -814,7 +814,7 @@ BEGIN
|
||||
END;
|
||||
END LOOP;
|
||||
|
||||
FOR rec IN c_loc_del
|
||||
FOR rec IN c_loc_recht
|
||||
LOOP
|
||||
BEGIN
|
||||
-- Alle managers zonder WP's uit de autorisatiegroep Locatiemanagers halen (key 24)
|
||||
@@ -824,14 +824,26 @@ BEGIN
|
||||
|
||||
v_errorhint := 'verwijderen locatiemanager uit autorisatiegroep';
|
||||
|
||||
IF rec.aantal_wp = 0
|
||||
IF rec.aantal_wp = 0 AND rec.groep = 1
|
||||
THEN
|
||||
|
||||
DELETE
|
||||
FROM fac_gebruikersgroep
|
||||
WHERE fac_gebruikersgroep_key = rec.fac_gebruikersgroep_key ;
|
||||
WHERE fac_groep_key = c_fac_groep_key AND prs_perslid_key = rec.prs_perslid_key ;
|
||||
|
||||
END IF;
|
||||
|
||||
v_errorhint := 'toevoegen locatiemanagers aan autorisatiegroep';
|
||||
|
||||
IF rec.aantal_wp > 0 AND rec.groep = 0
|
||||
THEN
|
||||
|
||||
INSERT INTO fac_gebruikersgroep (fac_groep_key,
|
||||
prs_perslid_key)
|
||||
VALUES (c_fac_groep_key,
|
||||
rec.prs_perslid_key) ;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
END LOOP;
|
||||
@@ -1028,6 +1040,22 @@ AS
|
||||
GROUP BY prs_perslid_key)
|
||||
ORDER BY 1, 2;
|
||||
|
||||
CURSOR c_loc_recht -- Voor onderhouder van de regiomanagers en directeuren in de autorisatiegroepen
|
||||
IS
|
||||
SELECT p.prs_perslid_key, p.naam,
|
||||
(SELECT count(*) FROM prs_perslidwerkplek wp WHERE wp.prs_perslid_key = p.prs_perslid_key) aantal_wp,
|
||||
(SELECT count(*) FROM fac_gebruikersgroep gg WHERE gg.prs_perslid_key = p.prs_perslid_key AND gg.fac_groep_key = 201) groep
|
||||
FROM blos_v_personenlijst_clus p
|
||||
WHERE p.prs_perslid_verwijder IS NULL
|
||||
UNION
|
||||
SELECT p.prs_perslid_key, p.naam,
|
||||
(SELECT count(*) FROM prs_perslidwerkplek wp WHERE wp.prs_perslid_key = p.prs_perslid_key) aantal_wp,
|
||||
(SELECT count(*) FROM fac_gebruikersgroep gg WHERE gg.prs_perslid_key = p.prs_perslid_key AND gg.fac_groep_key = 201) groep
|
||||
FROM blos_v_personenlijst_dir p
|
||||
WHERE p.prs_perslid_verwijder IS NULL
|
||||
ORDER BY 1 ;
|
||||
|
||||
|
||||
v_errormsg VARCHAR2 (1000);
|
||||
v_errorhint VARCHAR2 (1000);
|
||||
oracle_err_mes VARCHAR2 (200);
|
||||
@@ -1043,6 +1071,7 @@ AS
|
||||
v_prs_perslid_key NUMBER (10);
|
||||
v_kostenplaats_actueel NUMBER(1);
|
||||
v_upsert_sync NUMBER(1);
|
||||
c_fac_groep_key NUMBER(10) := 201 ; -- standaard autorisatiegroep voor Regiomanagers en Directeuren
|
||||
|
||||
BEGIN
|
||||
v_count := 0;
|
||||
@@ -1240,6 +1269,40 @@ BEGIN
|
||||
END;
|
||||
END LOOP;
|
||||
|
||||
FOR rec IN c_loc_recht
|
||||
LOOP
|
||||
BEGIN
|
||||
-- Alle managers zonder WP's uit de autorisatiegroep Locatiemanagers halen (key 24)
|
||||
v_aanduiding :=
|
||||
'bijwerken regiomanager en directeuren - perslid_key:'
|
||||
|| TO_CHAR (rec.prs_perslid_key);
|
||||
|
||||
v_errorhint := 'verwijderen regiomanager/directeur uit autorisatiegroep';
|
||||
|
||||
IF rec.aantal_wp = 0 AND rec.groep = 1
|
||||
THEN
|
||||
|
||||
DELETE
|
||||
FROM fac_gebruikersgroep
|
||||
WHERE fac_groep_key = c_fac_groep_key AND prs_perslid_key = rec.prs_perslid_key ;
|
||||
|
||||
END IF;
|
||||
|
||||
v_errorhint := 'toevoegen regiomanager/directeur aan autorisatiegroep';
|
||||
|
||||
IF rec.aantal_wp > 0 AND rec.groep = 0
|
||||
THEN
|
||||
|
||||
INSERT INTO fac_gebruikersgroep (fac_groep_key,
|
||||
prs_perslid_key)
|
||||
VALUES (c_fac_groep_key,
|
||||
rec.prs_perslid_key) ;
|
||||
|
||||
END IF;
|
||||
|
||||
END;
|
||||
END LOOP;
|
||||
|
||||
EXCEPTION
|
||||
WHEN OTHERS
|
||||
THEN
|
||||
|
||||
Reference in New Issue
Block a user