From 28e117aac73da564d435750415e110adaee45833 Mon Sep 17 00:00:00 2001 From: Mikhail Chechnev Date: Tue, 8 Jan 2019 15:22:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=80=D0=B8=D0=B3=D0=B8=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D0=B0=20=D1=83?= =?UTF-8?q?=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/in_queue.js | 8 ++-- core/out_queue_processor.js | 13 ++++-- db/PKG_EXS.pck | 37 +++++++++++------ db/P_EXSQUEUE_BASE_EXPORT.prc | 70 ++++++++++++++++++++++++++++++++ db/P_EXSQUEUE_BASE_INSERT.prc | 62 ++++++++++++++++++++++++++++ db/P_EXSQUEUE_EXPORT.prc | 40 ++++++++++++++++++ db/UDO_PKG_EXS_TEST.pck | 5 ++- db/v_exsqueue.sql | 47 +++++++++++++++++++++ models/prms_db_connector.js | 40 +++++++++++++----- modules/parus_atol_v4_ffd1.05.js | 1 + modules/parus_oracle_db.js | 3 +- 11 files changed, 294 insertions(+), 32 deletions(-) create mode 100644 db/P_EXSQUEUE_BASE_EXPORT.prc create mode 100644 db/P_EXSQUEUE_BASE_INSERT.prc create mode 100644 db/P_EXSQUEUE_EXPORT.prc create mode 100644 db/v_exsqueue.sql diff --git a/core/in_queue.js b/core/in_queue.js index ac6234c..451439d 100644 --- a/core/in_queue.js +++ b/core/in_queue.js @@ -13,7 +13,7 @@ const express = require("express"); //WEB-сервер Express const bodyParser = require("body-parser"); //Модуль для Express (разбор тела входящего запроса) const { ServerError } = require("./server_errors"); //Типовая ошибка const { makeErrorText, validateObject, buildURL, getAppSrvFunction } = require("./utils"); //Вспомогательные функции -const { NINC_EXEC_CNT_YES } = require("../models/prms_db_connector"); //Схемы валидации параметров функций модуля взаимодействия с БД +const { NINC_EXEC_CNT_YES, NIS_ORIGINAL_NO } = require("../models/prms_db_connector"); //Схемы валидации параметров функций модуля взаимодействия с БД const objInQueueSchema = require("../models/obj_in_queue"); //Схема валидации сообщений обмена с бработчиком очереди входящих сообщений const objServiceSchema = require("../models/obj_service"); //Схемы валидации сервиса const objServiceFnSchema = require("../models/obj_service_function"); //Схемы валидации функции сервиса @@ -160,7 +160,8 @@ class InQueue extends EventEmitter { blResp = resBefore.blResp; q = await this.dbConn.setQueueResp({ nQueueId: q.nId, - blResp + blResp, + nIsOriginal: NIS_ORIGINAL_NO }); } //Если пришел флаг ошибочной аутентификации и он положительный - то это ошибка, дальше ничего не делаем @@ -235,7 +236,8 @@ class InQueue extends EventEmitter { blResp = resAfter.blResp; q = await this.dbConn.setQueueResp({ nQueueId: q.nId, - blResp + blResp, + nIsOriginal: NIS_ORIGINAL_NO }); } //Если пришел флаг ошибочной аутентификации и он положительный - то это ошибка, дальше ничего не делаем diff --git a/core/out_queue_processor.js b/core/out_queue_processor.js index a148f4f..c95653d 100644 --- a/core/out_queue_processor.js +++ b/core/out_queue_processor.js @@ -26,7 +26,12 @@ const { SERR_DB_SERVER, SERR_UNAUTH } = require("./constants"); //Глобальные константы -const { NINC_EXEC_CNT_YES, NINC_EXEC_CNT_NO } = require("../models/prms_db_connector"); //Схемы валидации параметров функций модуля взаимодействия с БД +const { + NINC_EXEC_CNT_YES, + NINC_EXEC_CNT_NO, + NIS_ORIGINAL_NO, + NIS_ORIGINAL_YES +} = require("../models/prms_db_connector"); //Схемы валидации параметров функций модуля взаимодействия с БД //-------------------------- // Глобальные идентификаторы @@ -205,7 +210,8 @@ const appProcess = async prms => { prms.queue.blResp = new Buffer(serverResp); await dbConn.setQueueResp({ nQueueId: prms.queue.nId, - blResp: prms.queue.blResp + blResp: prms.queue.blResp, + nIsOriginal: NIS_ORIGINAL_YES }); //Выполняем обработчик "После" (если он есть) if (prms.function.sAppSrvAfter) { @@ -231,7 +237,8 @@ const appProcess = async prms => { prms.queue.blResp = resAfter.blResp; await dbConn.setQueueResp({ nQueueId: prms.queue.nId, - blResp: prms.queue.blResp + blResp: prms.queue.blResp, + nIsOriginal: NIS_ORIGINAL_NO }); } //Применим ответ "После" - флаг утентификации сервиса diff --git a/db/PKG_EXS.pck b/db/PKG_EXS.pck index 4e47457..8b40862 100644 --- a/db/PKG_EXS.pck +++ b/db/PKG_EXS.pck @@ -120,6 +120,10 @@ create or replace package PKG_EXS as NQUEUE_RESET_DATA_NO constant number(1) := 0; -- NQUEUE_RESET_DATA_YES constant number(1) := 1; -- + /* - */ + NIS_ORIGINAL_NO constant number(1) := 0; -- + NIS_ORIGINAL_YES constant number(1) := 1; -- + /* - */ SPRC_RESP_ARGS constant varchar2(80) := 'NIDENT,IN,NUMBER;NEXSQUEUE,IN,NUMBER;'; -- @@ -478,16 +482,18 @@ create or replace package PKG_EXS as /* */ procedure QUEUE_RESP_SET ( - NEXSQUEUE in number, -- . - BRESP in blob -- + NEXSQUEUE in number, -- . + BRESP in blob, -- + NIS_ORIGINAL in number := NIS_ORIGINAL_NO -- (. NIS_ORIGINAL*, null - ) ); /* ( ) */ procedure QUEUE_RESP_SET ( - NEXSQUEUE in number, -- . - BRESP in blob, -- - RCQUEUE out sys_refcursor -- + NEXSQUEUE in number, -- . + BRESP in blob, -- + NIS_ORIGINAL in number := NIS_ORIGINAL_NO, -- (. NIS_ORIGINAL*, null - ) + RCQUEUE out sys_refcursor -- ); /* */ @@ -2115,13 +2121,17 @@ create or replace package body PKG_EXS as /* */ procedure QUEUE_RESP_SET ( - NEXSQUEUE in number, -- . - BRESP in blob -- + NEXSQUEUE in number, -- . + BRESP in blob, -- + NIS_ORIGINAL in number := NIS_ORIGINAL_NO -- (. NIS_ORIGINAL*, null - ) ) is begin /* */ - update EXSQUEUE T set T.RESP = BRESP where T.RN = NEXSQUEUE; + update EXSQUEUE T + set T.RESP = BRESP, + T.RESP_ORIGINAL = DECODE(NVL(NIS_ORIGINAL, NIS_ORIGINAL_NO), NIS_ORIGINAL_NO, T.RESP_ORIGINAL, BRESP) + where T.RN = NEXSQUEUE; if (sql%rowcount = 0) then PKG_MSG.RECORD_NOT_FOUND(NFLAG_SMART => 0, NDOCUMENT => NEXSQUEUE, SUNIT_TABLE => 'EXSQUEUE'); end if; @@ -2130,14 +2140,15 @@ create or replace package body PKG_EXS as /* ( ) */ procedure QUEUE_RESP_SET ( - NEXSQUEUE in number, -- . - BRESP in blob, -- - RCQUEUE out sys_refcursor -- + NEXSQUEUE in number, -- . + BRESP in blob, -- + NIS_ORIGINAL in number := NIS_ORIGINAL_NO, -- (. NIS_ORIGINAL*, null - ) + RCQUEUE out sys_refcursor -- ) is begin /* */ - QUEUE_RESP_SET(NEXSQUEUE => NEXSQUEUE, BRESP => BRESP); + QUEUE_RESP_SET(NEXSQUEUE => NEXSQUEUE, BRESP => BRESP, NIS_ORIGINAL => NIS_ORIGINAL); /* */ QUEUE_GET(NFLAG_SMART => 0, NEXSQUEUE => NEXSQUEUE, RCQUEUE => RCQUEUE); end QUEUE_RESP_SET; @@ -2401,7 +2412,7 @@ create or replace package body PKG_EXS as /* ( - , - ) */ if ((REXSSERVICE.SRV_TYPE = NSRV_TYPE_RECIVE) or ((REXSSERVICE.SRV_TYPE = NSRV_TYPE_SEND) and (BRESP is not null) and (DBMS_LOB.GETLENGTH(BRESP) > 0))) then - QUEUE_RESP_SET(NEXSQUEUE => REXSQUEUE.RN, BRESP => BRESP); + QUEUE_RESP_SET(NEXSQUEUE => REXSQUEUE.RN, BRESP => BRESP, NIS_ORIGINAL => NIS_ORIGINAL_NO); end if; /* */ if (REXSSERVICEFN.FN_TYPE = NFN_TYPE_LOGIN) then diff --git a/db/P_EXSQUEUE_BASE_EXPORT.prc b/db/P_EXSQUEUE_BASE_EXPORT.prc new file mode 100644 index 0000000..09e6a77 --- /dev/null +++ b/db/P_EXSQUEUE_BASE_EXPORT.prc @@ -0,0 +1,70 @@ +create or replace procedure P_EXSQUEUE_BASE_EXPORT +( + NRN in number, -- + NIDENT in number, -- + STYPE_FILE in varchar2, -- + NMSG in number, -- (0 - , 1 - ) + NRESP in number, -- (0 - , 1 - ) + NMSG_ORIGINAL in number, -- (0 - , 1 - ) + NRESP_ORIGINAL in number -- (0 - , 1 - ) +) +as + SFILENAME PKG_STD.TSTRING; -- + DIN_DATE EXSQUEUE.IN_DATE%type; -- + SIN_AUTHID EXSQUEUE.IN_AUTHID%type; -- , + BMSG EXSQUEUE.MSG%type; -- + BRESP EXSQUEUE.RESP%type; -- + BMSG_ORIGINAL EXSQUEUE.MSG_ORIGINAL%type; -- + BRESP_ORIGINAL EXSQUEUE.RESP_ORIGINAL%type; -- +begin + /* */ + begin + select IN_DATE, + IN_AUTHID, + MSG, + RESP, + MSG_ORIGINAL, + RESP_ORIGINAL + into DIN_DATE, + SIN_AUTHID, + BMSG, + BRESP, + BMSG_ORIGINAL, + BRESP_ORIGINAL + from EXSQUEUE + where RN = NRN; + exception + when NO_DATA_FOUND then + PKG_MSG.RECORD_NOT_FOUND(NFLAG_SMART => 0, NDOCUMENT => NRN); + end; + /* */ + SFILENAME := TO_CHAR(NRN) || '_' || TO_CHAR(DIN_DATE, 'dd_mm_yyyy_hh24_mi') || '_' || SIN_AUTHID || + NULLIF('.' || STYPE_FILE, '.'); + /* */ + if (NMSG = 1) then + /* */ + P_FILE_BUFFER_INSERT(NIDENT => NIDENT, CFILENAME => 'MESSAGE_' || SFILENAME, CDATA => null, BLOBDATA => BMSG); + end if; + /* */ + if (NRESP = 1) then + /* */ + P_FILE_BUFFER_INSERT(NIDENT => NIDENT, CFILENAME => 'RESPOND_' || SFILENAME, CDATA => null, BLOBDATA => BRESP); + end if; + /* */ + if (NMSG_ORIGINAL = 1) then + /* */ + P_FILE_BUFFER_INSERT(NIDENT => NIDENT, + CFILENAME => 'MESSAGE_ORIGINAL_' || SFILENAME, + CDATA => null, + BLOBDATA => BMSG_ORIGINAL); + end if; + /* */ + if (NRESP_ORIGINAL = 1) then + /* */ + P_FILE_BUFFER_INSERT(NIDENT => NIDENT, + CFILENAME => 'RESPOND_ORIGINAL_' || SFILENAME, + CDATA => null, + BLOBDATA => BRESP_ORIGINAL); + end if; +end; +/ diff --git a/db/P_EXSQUEUE_BASE_INSERT.prc b/db/P_EXSQUEUE_BASE_INSERT.prc new file mode 100644 index 0000000..cbbceee --- /dev/null +++ b/db/P_EXSQUEUE_BASE_INSERT.prc @@ -0,0 +1,62 @@ +create or replace procedure P_EXSQUEUE_BASE_INSERT +( + DIN_DATE in date, -- + SIN_AUTHID in varchar2, -- , + NEXSSERVICEFN in number, -- " ()" + DEXEC_DATE in date, -- + NEXEC_CNT in number, -- + NEXEC_STATE in number, -- + SEXEC_MSG in varchar2, -- + BMSG in blob, -- + BRESP in blob, -- + NEXSQUEUE in number, -- + NLNK_COMPANY in number, -- + NLNK_DOCUMENT in number, -- + SLNK_UNITCODE in varchar2, -- + SOPTIONS in varchar2, -- + NRN out number -- +) +as +begin + /* */ + NRN := GEN_ID; + + /* */ + insert into EXSQUEUE + (RN, + IN_DATE, + IN_AUTHID, + EXSSERVICEFN, + EXEC_DATE, + EXEC_CNT, + EXEC_STATE, + EXEC_MSG, + MSG, + RESP, + EXSQUEUE, + LNK_COMPANY, + LNK_DOCUMENT, + LNK_UNITCODE, + MSG_ORIGINAL, + RESP_ORIGINAL, + OPTIONS) + values + (NRN, + DIN_DATE, + SIN_AUTHID, + NEXSSERVICEFN, + DEXEC_DATE, + NEXEC_CNT, + NEXEC_STATE, + SEXEC_MSG, + BMSG, + BRESP, + NEXSQUEUE, + NLNK_COMPANY, + NLNK_DOCUMENT, + SLNK_UNITCODE, + BMSG, + BRESP, + SOPTIONS); +end; +/ diff --git a/db/P_EXSQUEUE_EXPORT.prc b/db/P_EXSQUEUE_EXPORT.prc new file mode 100644 index 0000000..97e1194 --- /dev/null +++ b/db/P_EXSQUEUE_EXPORT.prc @@ -0,0 +1,40 @@ +create or replace procedure P_EXSQUEUE_EXPORT +( + NRN in number, -- + NIDENT in number, -- + STYPE_FILE in varchar2, -- + NMSG in number, -- (0 - , 1 - ) + NRESP in number, -- (0 - , 1 - ) + NMSG_ORIGINAL in number, -- (0 - , 1 - ) + NRESP_ORIGINAL in number -- (0 - , 1 - ) +) +as +begin + /* */ + PKG_ENV.PROLOGUE(NCOMPANY => null, + NVERSION => null, + NCATALOG => null, + SUNIT => 'EXSQueue', + SACTION => 'EXSQUEUE_EXPORT', + STABLE => 'EXSQUEUE', + NDOCUMENT => NRN); + + /* */ + P_EXSQUEUE_BASE_EXPORT(NRN => NRN, + NIDENT => NIDENT, + STYPE_FILE => STYPE_FILE, + NMSG => NMSG, + NRESP => NRESP, + NMSG_ORIGINAL => NMSG_ORIGINAL, + NRESP_ORIGINAL => NRESP_ORIGINAL); + + /* */ + PKG_ENV.EPILOGUE(NCOMPANY => null, + NVERSION => null, + NCATALOG => null, + SUNIT => 'EXSQueue', + SACTION => 'EXSQUEUE_EXPORT', + STABLE => 'EXSQUEUE', + NDOCUMENT => NRN); +end; +/ diff --git a/db/UDO_PKG_EXS_TEST.pck b/db/UDO_PKG_EXS_TEST.pck index f609463..8c3cba3 100644 --- a/db/UDO_PKG_EXS_TEST.pck +++ b/db/UDO_PKG_EXS_TEST.pck @@ -123,7 +123,10 @@ create or replace package body UDO_PKG_EXS_TEST as /* */ CRESP := BLOB2CLOB(LBDATA => REXSQUEUE.RESP, SCHARSET => 'UTF8'); /* ( ) */ - PKG_EXS.QUEUE_RESP_SET(NEXSQUEUE => REXSQUEUE.RN, BRESP => CLOB2BLOB(LCDATA => CRESP), RCQUEUE => RCTMP); + PKG_EXS.QUEUE_RESP_SET(NEXSQUEUE => REXSQUEUE.RN, + BRESP => CLOB2BLOB(LCDATA => CRESP), + NIS_ORIGINAL => PKG_EXS.NIS_ORIGINAL_NO, + RCQUEUE => RCTMP); /* */ begin select EXTRACTVALUE(XMLTYPE(CMSG), '/MSG/NCOMPANY') NCOMPANY into NCOMPANY from DUAL; diff --git a/db/v_exsqueue.sql b/db/v_exsqueue.sql new file mode 100644 index 0000000..166aad6 --- /dev/null +++ b/db/v_exsqueue.sql @@ -0,0 +1,47 @@ +create or replace view v_exsqueue +(nrn, din_date, sin_authid, nexsservicefn, sexsservicefn_code, dexec_date, nexec_cnt, nexec_state, sexec_msg, bmsg, bresp, nexsqueue, nexsservice, sexsservice_code, nexsservice_srv_type, nexsmsgtype, nretry_schedule, nretry_step, nretry_attempts, sexsmsgtype_code, nlnk_company, slnk_company, nlnk_document, slnk_unitcode, slnk_unitname, bmsg_original, bresp_original, nchild_count, soptions) +as +select + T.RN, -- NRN + T.IN_DATE, -- DIN_DATE + T.IN_AUTHID, -- SIN_AUTHID + T.EXSSERVICEFN, -- NEXSSERVICEFN + E.CODE, -- SEXSSERVICEFN_CODE + T.EXEC_DATE, -- DEXEC_DATE + T.EXEC_CNT, -- NEXEC_CNT + T.EXEC_STATE, -- NEXEC_STATE + T.EXEC_MSG, -- SEXEC_MSG + T.MSG, -- BMSG + T.RESP, -- BRESP + T.EXSQUEUE, -- NEXSQUEUE + E.PRN, -- NEXSSERVICE + S.CODE, -- SEXSSERVICE_CODE + S.SRV_TYPE, -- NEXSSERVICE_SRV_TYPE + E.EXSMSGTYPE, -- NEXSMSGTYPE + E.RETRY_SCHEDULE, -- NRETRY_SCHEDULE + E.RETRY_STEP, -- NRETRY_STEP + E.RETRY_ATTEMPTS, -- NRETRY_ATTEMPTS + M.CODE, -- SEXSMSGTYPE_CODE + T.LNK_COMPANY, -- NLNK_COMPANY + C.NAME, -- SLNK_COMPANY + T.LNK_DOCUMENT, -- NLNK_DOCUMENT + T.LNK_UNITCODE, -- SLNK_UNITCODE + U.UNITNAME, -- SLNK_UNITNAME + T.MSG_ORIGINAL, -- BMSG_ORIGINAL + T.RESP_ORIGINAL, -- BRESP_ORIGINAL + F_EXSQUEUE_GET_CHILD_COUNT(T.RN), -- NCHILD_COUNT + T.OPTIONS -- SOPTIONS +from + EXSQUEUE T, + EXSSERVICE S, + EXSSERVICEFN E, + EXSMSGTYPE M, + COMPANIES C, + UNITLIST U +where T.EXSSERVICEFN = E.RN + and E.EXSMSGTYPE = M.RN + and E.PRN = S.RN + and T.LNK_COMPANY = C.RN (+) + and T.LNK_UNITCODE = U.UNITCODE (+) + and exists (select null from V_USERPRIV UP where UP.UNITCODE = 'EXSQueue') +; diff --git a/models/prms_db_connector.js b/models/prms_db_connector.js index b9d89bd..b72abcd 100644 --- a/models/prms_db_connector.js +++ b/models/prms_db_connector.js @@ -32,6 +32,10 @@ const { NINC_EXEC_CNT_NO = 0; //Не инкрементировать NINC_EXEC_CNT_YES = 1; //Инкрементировать +//Признак оригинала данных +NIS_ORIGINAL_NO = 0; //Оригинал +NIS_ORIGINAL_YES = 1; //Не оригинал + //------------ // Тело модуля //------------ @@ -54,6 +58,8 @@ const validateBuffer = val => { //Константы exports.NINC_EXEC_CNT_NO = NINC_EXEC_CNT_NO; exports.NINC_EXEC_CNT_YES = NINC_EXEC_CNT_YES; +exports.NIS_ORIGINAL_NO = NIS_ORIGINAL_NO; +exports.NIS_ORIGINAL_YES = NIS_ORIGINAL_YES; //Схема валидации параметров конструктора exports.DBConnector = new Schema({ @@ -404,8 +410,8 @@ exports.getQueueMsg = new Schema({ type: Number, required: true, message: { - type: path => `Идентификатор позиции очереди ((${path}) имеет некорректный тип данных (ожидалось - Number)`, - required: path => `Не указан идентификатор позиции очереди ((${path})` + type: path => `Идентификатор позиции очереди (${path}) имеет некорректный тип данных (ожидалось - Number)`, + required: path => `Не указан идентификатор позиции очереди (${path})` } } }); @@ -417,8 +423,8 @@ exports.setQueueMsg = new Schema({ type: Number, required: true, message: { - type: path => `Идентификатор позиции очереди ((${path}) имеет некорректный тип данных (ожидалось - Number)`, - required: path => `Не указан идентификатор позиции очереди ((${path})` + type: path => `Идентификатор позиции очереди (${path}) имеет некорректный тип данных (ожидалось - Number)`, + required: path => `Не указан идентификатор позиции очереди (${path})` } }, //Данные сообщения очереди обмена @@ -440,8 +446,8 @@ exports.getQueueResp = new Schema({ type: Number, required: true, message: { - type: path => `Идентификатор позиции очереди ((${path}) имеет некорректный тип данных (ожидалось - Number)`, - required: path => `Не указан идентификатор позиции очереди ((${path})` + type: path => `Идентификатор позиции очереди (${path}) имеет некорректный тип данных (ожидалось - Number)`, + required: path => `Не указан идентификатор позиции очереди (${path})` } } }); @@ -453,8 +459,8 @@ exports.setQueueResp = new Schema({ type: Number, required: true, message: { - type: path => `Идентификатор позиции очереди ((${path}) имеет некорректный тип данных (ожидалось - Number)`, - required: path => `Не указан идентификатор позиции очереди ((${path})` + type: path => `Идентификатор позиции очереди (${path}) имеет некорректный тип данных (ожидалось - Number)`, + required: path => `Не указан идентификатор позиции очереди (${path})` } }, //Данные ответа сообщения очереди обмена @@ -466,8 +472,20 @@ exports.setQueueResp = new Schema({ `Данные ответа сообщения очереди обмена (${path}) имеют некорректный тип данных (ожидалось - null или Buffer)`, required: path => `Не указаны данные ответа сообщения очереди обмена (${path})` } + }, + //Признак передачи оригинала ответа + nIsOriginal: { + type: Number, + enum: [NIS_ORIGINAL_NO, NIS_ORIGINAL_YES], + required: true, + message: { + type: path => + `Признак передачи оригинала ответа (${path}) имеет некорректный тип данных (ожидалось - Number)`, + enum: path => `Значение признака передачи оригинала ответа (${path}) не поддерживается`, + required: path => `Не указан признак передачи оригинала ответа (${path})` + } } -}).validator({ required: val => val === null || val }); +}).validator({ required: val => val === null || val === 0 || val }); //Схема валидации параметров функции установки результата обработки позиции очереди exports.setQueueAppSrvResult = new Schema({ @@ -476,8 +494,8 @@ exports.setQueueAppSrvResult = new Schema({ type: Number, required: true, message: { - type: path => `Идентификатор позиции очереди ((${path}) имеет некорректный тип данных (ожидалось - Number)`, - required: path => `Не указан идентификатор позиции очереди ((${path})` + type: path => `Идентификатор позиции очереди (${path}) имеет некорректный тип данных (ожидалось - Number)`, + required: path => `Не указан идентификатор позиции очереди (${path})` } }, //Данные сообщения очереди обмена diff --git a/modules/parus_atol_v4_ffd1.05.js b/modules/parus_atol_v4_ffd1.05.js index 10b1e2e..5b885b9 100644 --- a/modules/parus_atol_v4_ffd1.05.js +++ b/modules/parus_atol_v4_ffd1.05.js @@ -288,6 +288,7 @@ const afterConnect = async prms => { } if (resp.error === null) { return { + blResp: new Buffer(resp.token), sCtx: resp.token, dCtxExp: strDDMMYYYYHHMISStoDate(resp.timestamp).addHours(24) }; diff --git a/modules/parus_oracle_db.js b/modules/parus_oracle_db.js index 150d6e1..86fc636 100644 --- a/modules/parus_oracle_db.js +++ b/modules/parus_oracle_db.js @@ -341,10 +341,11 @@ const getQueueResp = async prms => { const setQueueResp = async prms => { try { let res = await prms.connection.execute( - "BEGIN PKG_EXS.QUEUE_RESP_SET(NEXSQUEUE => :NEXSQUEUE, BRESP => :BRESP, RCQUEUE => :RCQUEUE); END;", + "BEGIN PKG_EXS.QUEUE_RESP_SET(NEXSQUEUE => :NEXSQUEUE, BRESP => :BRESP, NIS_ORIGINAL => :NIS_ORIGINAL, RCQUEUE => :RCQUEUE); END;", { NEXSQUEUE: prms.nQueueId, BRESP: prms.blResp, + NIS_ORIGINAL: prms.nIsOriginal, RCQUEUE: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT } }, { outFormat: oracledb.OBJECT, autoCommit: true }