From 826327ade0553c5adb62df338f2882321c16f014 Mon Sep 17 00:00:00 2001 From: Ernest Litvinenko Date: Fri, 5 Jul 2024 01:03:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=20EX?= =?UTF-8?q?EC=5FBLOCK=20=D0=B4=D0=BB=D1=8F=20=D0=9F=D0=B0=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D0=BD=D0=B3=D0=B0=20APP=5FEVENT=5FDATA=20=D0=BD=D0=B0=20?= =?UTF-8?q?32=20-2,=20=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20ID=5FAPP=5FTASK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 32_7.sql | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/32_7.sql b/32_7.sql index ff844a9..cee0cbe 100644 --- a/32_7.sql +++ b/32_7.sql @@ -78,17 +78,17 @@ begin :F_APP_EVENT_WCR, :F_APP_EVENT_CH, :F_APP_EVENT_WCH, :F_APP_EVENT_SEANS, :F_APP_EVENT_OWNERMST, :F_APP_EVENT_FIMP, :F_APP_EVENT_MPOST; - -- Получаем текст EXEC 32 -1 + -- Получаем текст EXEC 32 -2 select E.EXEC_BLOCKS_TEXT from EXEC_BLOCKS E where E.EXEC_BLOCKS_VID = 32 and - E.EXEC_BLOCKS_TIP = -1 and + E.EXEC_BLOCKS_TIP = -2 and E.EXEC_BLOCKS_DEL = 0 rows 1 to 1 into :EXEC_BLOCK_TEXT_32_NEG_1; if (:EXEC_BLOCK_TEXT_32_NEG_1 is null) then begin - output = -1;/*Не найден EXEC BLOCK 32 -1 */ + output = -1;/*Не найден EXEC BLOCK 32 -2 */ suspend; exit; end @@ -145,6 +145,20 @@ begin NEW_APP_NOTE_WCR = F_APP_EVENT_WCR; NEW_APP_NOTE_CH = F_APP_EVENT_CH; NEW_APP_NOTE_WCH = F_APP_EVENT_WCH; + + /*Парсим параметры JSON-a APP_EVENT_DATA*/ + for execute statement(:EXEC_BLOCK_TEXT_32_NEG_1)(IN_PARAM_JSON := :F_APP_EVENT_DATA) + into :EXEC_BLOCK_32_NEG_1_OUT_VAL, :EXEC_BLOCK_32_NEG_1_OUT_KEY + do + begin + if (:EXEC_BLOCK_32_NEG_1_OUT_KEY = '8794') then + NEW_APP_NOTE_STATUS = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_INTEGER); + else + if (:EXEC_BLOCK_32_NEG_1_OUT_KEY = 'ID_APP_TASK') then + NEW_APP_NOTE_ID_APP_TASK = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_BIGINT); + + end + end else if (:F_APP_EVENT_VID = 8797) then @@ -154,20 +168,20 @@ begin into :EXEC_BLOCK_32_NEG_1_OUT_VAL, :EXEC_BLOCK_32_NEG_1_OUT_KEY do begin - if (:exec_block_32_neg_1_out_key = 8794) then - begin - NEW_APP_NOTE_STATUS = cast(:exec_block_32_neg_1_out_val as d_integer); - end + if (:EXEC_BLOCK_32_NEG_1_OUT_KEY = '8794') then + begin + NEW_APP_NOTE_STATUS = cast(:EXEC_BLOCK_32_NEG_1_OUT_VAL as D_INTEGER); + end end end end - IF (new_id_app_note is null) then + if (NEW_ID_APP_NOTE is null) then begin - output = -5; /*Не было создано событие о создании Уведомсления (8795) */ - suspend; - exit; - end + output = -5;/*Не было создано событие о создании Уведомсления (8795) */ + suspend; + exit; + end update or insert into APP_NOTE (ID_APP_NOTE, APP_NOTE_ID_SOTR, APP_NOTE_ID_APP_TASK, APP_NOTE_STATUS, APP_NOTE_TIP, APP_NOTE_TEXT, APP_NOTE_DEL, APP_NOTE_CR, APP_NOTE_WCR, APP_NOTE_CH, APP_NOTE_WCH)