FCLT#85890 Orderqueue en notificatiequeue savepoint

svn path=/Database/trunk/; revision=67766
This commit is contained in:
Jos Groot Lipman
2025-01-28 15:59:07 +00:00
parent e4912ec5cd
commit 4ac5450681
7 changed files with 171 additions and 98 deletions

View File

@@ -423,6 +423,51 @@ BEGIN
THEN
fac.clrnotifications ('MLDAP1', :new.mld_opdr_key);
END IF;
// Nog tijdelijk backwards compatible met cust-code die mld_opdr_teverzenden op 2 zet
IF :OLD.mld_opdr_teverzenden = 2 AND :OLD.mld_opdr_verzonden IS NULL
THEN
NULL; -- stond hij al in de queue
ELSIF :NEW.mld_opdr_teverzenden = 2 AND :NEW.mld_opdr_verzonden IS NULL
THEN -- Zou hij vroeger in de fac_v_orderqueue herverschijnen
-- ORDUPD tracking/notificatie
--mld.notifyopdrbedrijven (:new.mld_opdr_key, ptrackingkey => NULL); geeft trigger mutating
FOR bedrijfrec
IN (SELECT b.prs_bedrijf_key,
COALESCE (l1.alg_locatie_key, l2.alg_locatie_key) alg_locatie_key,
COALESCE (l1.alg_locatie_email, l2.alg_locatie_email) alg_locatie_email,
:NEW.mld_melding_key || '/' || :NEW.mld_opdr_bedrijfopdr_volgnr reference,
d.prs_bedrijf_key persoon_bedrijf_key, -- van de melder, niet de uitvoerende
fac_srtnotificatie_key
FROM mld_melding m,
mld_adres ma,
alg_locatie l1,
alg_locatie l2,
prs_perslid p,
prs_v_afdeling d,
prs_bedrijf b,
fac_srtnotificatie fsn
WHERE b.prs_bedrijf_key = :NEW.mld_uitvoerende_keys
AND :NEW.mld_melding_key = m.mld_melding_key
AND m.mld_adres_key = ma.mld_adres_key(+)
AND ma.alg_locatie_key = l1.alg_locatie_key(+)
AND m.mld_alg_locatie_key = l2.alg_locatie_key(+)
AND d.prs_afdeling_key = p.prs_afdeling_key
AND p.prs_perslid_key = m.prs_perslid_key
AND fac_srtnotificatie_code = 'ORDUPD') -- hardcoded ORDUPD, het gaat uiteindelijk vooral om de XMLnode 'opdracht' in putorders
LOOP
fac.notifybedrijf (pbedrijf_key => bedrijfrec.prs_bedrijf_key,
pbedrijfadres_type => 'O',
prefkey => :NEW.mld_opdr_key,
ptrackingkey => NULL,
psrtnoti_key => bedrijfrec.fac_srtnotificatie_key,
preference => bedrijfrec.reference,
ptypeopdr_key => :NEW.mld_typeopdr_key,
plocatie_key => bedrijfrec.alg_locatie_key,
pdisc_key => :NEW.mld_opdr_discipline_key,
psender => bedrijfrec.alg_locatie_email);
END LOOP;
END IF;
END;
/