RWSN#18815 notificatie
svn path=/Database/trunk/; revision=10485
This commit is contained in:
144
FAC/FAC_PAC.SRC
144
FAC/FAC_PAC.SRC
@@ -1,5 +1,5 @@
|
||||
/* $Revision: 198 $
|
||||
* $Modtime: 30-10-10 9:55 $
|
||||
/* $Revision: 199 $
|
||||
* $Modtime: 3-11-10 17:08 $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -385,13 +385,13 @@ CREATE OR REPLACE PACKAGE fac AS
|
||||
p_fielddelimitor IN VARCHAR2,
|
||||
p_field OUT VARCHAR2
|
||||
);
|
||||
|
||||
|
||||
PROCEDURE imp_getfield_nr (p_parseline IN VARCHAR2,
|
||||
p_fielddelimitor IN VARCHAR2,
|
||||
p_nr IN NUMBER,
|
||||
p_field OUT VARCHAR2
|
||||
);
|
||||
|
||||
|
||||
PROCEDURE imp_writelog( pAppl IN VARCHAR2,
|
||||
pRun IN VARCHAR2,
|
||||
pLevel IN VARCHAR2,
|
||||
@@ -1028,13 +1028,13 @@ CREATE OR REPLACE PACKAGE BODY fac AS
|
||||
AS
|
||||
l_parseline VARCHAR2(1024);
|
||||
l_nr NUMBER(10);
|
||||
|
||||
|
||||
BEGIN
|
||||
l_parseline :=p_parseline;
|
||||
l_nr :=p_nr;
|
||||
WHILE l_nr >= 1
|
||||
LOOP
|
||||
-- look for the next kolom in p_parseline
|
||||
-- look for the next kolom in p_parseline
|
||||
fac.imp_getfield (l_parseline, p_fielddelimitor, p_field);
|
||||
l_nr := l_nr -1;
|
||||
END LOOP;
|
||||
@@ -1951,27 +1951,26 @@ CREATE OR REPLACE PACKAGE BODY fac AS
|
||||
-- Als email of sms gevraagt wordt (smode) en email of mobile kan niet bepaald worden, wordt niet gequeued
|
||||
-- pprio is de prioriteit (1, 2 of 3) die geen effect heeft op de quebehandeling, maar wel wordt meegegeven
|
||||
-- psender is een optioneel emailadres dat als afzender kan worden gehanteerd.
|
||||
PROCEDURE putnotificationsrtprio (
|
||||
pfrom NUMBER,
|
||||
pto NUMBER,
|
||||
pcode VARCHAR2,
|
||||
pref NUMBER,
|
||||
poptmessage VARCHAR2,
|
||||
poptstatus NUMBER,
|
||||
poptemail VARCHAR2,
|
||||
poptmobile VARCHAR2,
|
||||
pxref NUMBER,
|
||||
pprio NUMBER,
|
||||
psender VARCHAR2
|
||||
)
|
||||
PROCEDURE putnotificationsrtprio (pfrom NUMBER,
|
||||
pto NUMBER,
|
||||
pcode VARCHAR2,
|
||||
pref NUMBER,
|
||||
poptmessage VARCHAR2,
|
||||
poptstatus NUMBER,
|
||||
poptemail VARCHAR2,
|
||||
poptmobile VARCHAR2,
|
||||
pxref NUMBER,
|
||||
pprio NUMBER,
|
||||
psender VARCHAR2)
|
||||
AS
|
||||
soms fac_srtnotificatie.fac_srtnotificatie_oms%TYPE;
|
||||
smode fac_srtnotificatie.fac_srtnotificatie_mode%TYPE;
|
||||
susermode fac_srtnotificatie.fac_srtnotificatie_usermode%TYPE;
|
||||
lmode fac_srtnotificatie.fac_srtnotificatie_mode%TYPE;
|
||||
skey fac_srtnotificatie.fac_srtnotificatie_key%TYPE;
|
||||
lemail prs_perslid.prs_perslid_email%TYPE;
|
||||
lphone prs_perslid.prs_perslid_mobiel%TYPE;
|
||||
soms fac_srtnotificatie.fac_srtnotificatie_oms%TYPE;
|
||||
smode fac_srtnotificatie.fac_srtnotificatie_mode%TYPE;
|
||||
oldersmode fac_srtnotificatie.fac_srtnotificatie_mode%TYPE;
|
||||
susermode fac_srtnotificatie.fac_srtnotificatie_usermode%TYPE;
|
||||
lmode fac_srtnotificatie.fac_srtnotificatie_mode%TYPE;
|
||||
skey fac_srtnotificatie.fac_srtnotificatie_key%TYPE;
|
||||
lemail prs_perslid.prs_perslid_email%TYPE;
|
||||
lphone prs_perslid.prs_perslid_mobiel%TYPE;
|
||||
BEGIN
|
||||
IF pcode IS NOT NULL
|
||||
THEN
|
||||
@@ -1979,11 +1978,17 @@ CREATE OR REPLACE PACKAGE BODY fac AS
|
||||
IF poptstatus IS NULL
|
||||
THEN
|
||||
-- Geen status/mode meegegeven, bepaal em zelf
|
||||
SELECT sn.fac_srtnotificatie_oms, sn.fac_srtnotificatie_mode, sn.fac_srtnotificatie_key,
|
||||
SELECT sn.fac_srtnotificatie_oms,
|
||||
sn.fac_srtnotificatie_mode,
|
||||
sn.fac_srtnotificatie_key,
|
||||
fac_srtnotificatie_usermode
|
||||
INTO soms, smode, skey, susermode
|
||||
INTO soms,
|
||||
smode,
|
||||
skey,
|
||||
susermode
|
||||
FROM fac_srtnotificatie sn
|
||||
WHERE sn.fac_srtnotificatie_code = pcode AND sn.fac_srtnotificatie_mode > 0;
|
||||
WHERE sn.fac_srtnotificatie_code = pcode
|
||||
AND sn.fac_srtnotificatie_mode > 0;
|
||||
|
||||
-- Als deze notificatiesoort userafhankelijk kan zijn, kijken we
|
||||
-- naar de status/mode die bij de user is aangegeven
|
||||
@@ -1993,7 +1998,8 @@ CREATE OR REPLACE PACKAGE BODY fac AS
|
||||
SELECT prs_perslid_srtnoti_mode
|
||||
INTO smode
|
||||
FROM prs_perslid
|
||||
WHERE prs_perslid_key = pto AND prs_perslid_srtnoti_mode IS NOT NULL;
|
||||
WHERE prs_perslid_key = pto
|
||||
AND prs_perslid_srtnoti_mode IS NOT NULL;
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND
|
||||
THEN
|
||||
@@ -2050,22 +2056,72 @@ CREATE OR REPLACE PACKAGE BODY fac AS
|
||||
lmode := BITAND (lmode, 255 - 4);
|
||||
END IF;
|
||||
|
||||
IF lmode > 0
|
||||
-- voorkom e-mail van RESUPD als de RESNEW nog niet eens de deur uit is door Putorders
|
||||
IF BITAND (smode, 2 + 4) <> 0
|
||||
THEN
|
||||
-- Stuur notificatie
|
||||
INSERT INTO fac_notificatie
|
||||
(fac_srtnotificatie_key, fac_notificatie_status, prs_perslid_key_sender,
|
||||
prs_perslid_key_receiver, fac_notificatie_receiver_email, fac_notificatie_receiver_phone,
|
||||
fac_notificatie_oms, fac_notificatie_refkey, fac_notificatie_extrakey,
|
||||
fac_notificatie_prioriteit, fac_notificatie_sender_email
|
||||
)
|
||||
VALUES (skey, lmode, pfrom,
|
||||
pto, lemail, lphone,
|
||||
soms, pref, pxref,
|
||||
pprio, psender
|
||||
);
|
||||
-- Zoek de lmode van een al/nog aanwezige fac_notificatie die over hetzelfde gaat
|
||||
BEGIN
|
||||
SELECT fac_notificatie_status
|
||||
INTO oldersmode
|
||||
FROM fac_v_notifyqueue ander
|
||||
WHERE (pcode = 'RESUPD'
|
||||
AND ander.fac_srtnotificatie_code IN ('RESUPD', 'RESNEW')
|
||||
OR pcode = 'MLDUPD'
|
||||
AND ander.fac_srtnotificatie_code IN
|
||||
('MLDUPD', 'MLDNEW'))
|
||||
AND ander.fac_notificatie_refkey = pref
|
||||
AND COALESCE (ander.fac_notificatie_extrakey, -1) =
|
||||
COALESCE (pxref, -1)
|
||||
AND COALESCE (ander.fac_notificatie_receiver_email, '') =
|
||||
COALESCE (lemail, '')
|
||||
AND COALESCE (ander.fac_notificatie_receiver_phone, '') =
|
||||
COALESCE (lphone, '')
|
||||
AND BITAND (fac_notificatie_status, 2 + 4) <> 0
|
||||
AND ROWNUM=1; -- anders te ingewikkeld
|
||||
EXCEPTION
|
||||
WHEN NO_DATA_FOUND
|
||||
THEN
|
||||
NULL;
|
||||
END;
|
||||
|
||||
IF BITAND (smode, 2) = 2 AND BITAND (oldersmode, 2) = 2
|
||||
THEN
|
||||
lmode := BITAND (lmode, 255 - 2);
|
||||
END IF;
|
||||
|
||||
IF BITAND (smode, 4) = 4 AND BITAND (oldersmode, 4) = 4
|
||||
THEN
|
||||
lmode := BITAND (lmode, 255 - 4);
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
IF lmode > 0
|
||||
THEN
|
||||
-- Stuur notificatie
|
||||
INSERT INTO fac_notificatie (fac_srtnotificatie_key,
|
||||
fac_notificatie_status,
|
||||
prs_perslid_key_sender,
|
||||
prs_perslid_key_receiver,
|
||||
fac_notificatie_receiver_email,
|
||||
fac_notificatie_receiver_phone,
|
||||
fac_notificatie_oms,
|
||||
fac_notificatie_refkey,
|
||||
fac_notificatie_extrakey,
|
||||
fac_notificatie_prioriteit,
|
||||
fac_notificatie_sender_email)
|
||||
VALUES (skey,
|
||||
lmode,
|
||||
pfrom,
|
||||
pto,
|
||||
lemail,
|
||||
lphone,
|
||||
soms,
|
||||
pref,
|
||||
pxref,
|
||||
pprio,
|
||||
psender);
|
||||
END IF;
|
||||
END;
|
||||
|
||||
-- Ruim zoveel mogelijk notificatiespul op voor dit item. Pcode mag een wildcard zijn!
|
||||
@@ -3078,4 +3134,4 @@ CREATE OR REPLACE PACKAGE BODY fac AS
|
||||
END fac;
|
||||
/
|
||||
|
||||
REGISTERRUN('$Workfile: FAC_PAC.SRC $','$Revision: 198 $')
|
||||
REGISTERRUN('$Workfile: FAC_PAC.SRC $','$Revision: 199 $')
|
||||
|
||||
Reference in New Issue
Block a user