From 4ec5b2bf6979c4974a8190e3db8615f4aa81b6fd Mon Sep 17 00:00:00 2001 From: msyu Date: Thu, 13 Mar 2025 17:46:49 +0300 Subject: [PATCH] 068 --- v1/Application.cfc | 104 ++++++++++++++++-------- v1/resources/instance_operation_run.cfc | 23 ++++-- v1/resources/notification_ls.cfc | 19 +++-- 3 files changed, 101 insertions(+), 45 deletions(-) diff --git a/v1/Application.cfc b/v1/Application.cfc index e0a4a48..2e83519 100644 --- a/v1/Application.cfc +++ b/v1/Application.cfc @@ -51,7 +51,7 @@ //variables.framework.docs={}; variables.framework.docs.APIName="Deck API"; - variables.framework.docs.APIVersion="0.067"; + variables.framework.docs.APIVersion="0.068"; variables.framework.globalHeaders = structNew(); variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location"; @@ -98,7 +98,28 @@ - + + + + @@ -108,9 +129,38 @@ + - + + + + + + select value as stand from config + where name='STAND' + + + + + + + + + + + + + + + + + + + + + + @@ -132,6 +182,8 @@ ---> + + function onTaffyRequest(verb, cfc, requestArguments, mimeExt, headers){ @@ -220,7 +272,19 @@ if (structIsEmpty(usrCustomerInfo)) return representationOf("User information not found").withStatus(404); } + if (lCase(arguments.cfc) EQ 'notification_ls') { //*** костыль: для нотификаций можно адресоваться к пользователю без контракта + if (structIsEmpty(usrCustomerInfo)) { + arguments.requestArguments.usrId=-1; //Integer! + arguments.requestArguments.contragentId=-1; //Integer + arguments.requestArguments.contractId=-1; //Integer + arguments.requestArguments.specificationId=-1; //Integer + + return true; + } + } + if (structIsEmpty(usrCustomerInfo)) return representationOf("Cannot find default specification for current user #result#").withStatus(422); //это создает довольно много лишних движений при отладке + arguments.requestArguments.usrId=usrCustomerInfo.usrId; //Integer! arguments.requestArguments.contragentId=usrCustomerInfo.contragentId; //Integer arguments.requestArguments.contractId=usrCustomerInfo.contractId; //Integer @@ -271,35 +335,7 @@ вероятно, лучше сделать токен девайса ---> - - - - - - - - - - select creator_id - from auth_token - where auth_token= - AND issued_for= - AND dt_valid_till > - - - - - - - - - - - - - - - + @@ -342,8 +378,8 @@ - + @@ -805,7 +841,7 @@ - + - + + + + insert into instance_operation_param (instance_operation_uid,param,param_value) @@ -187,8 +190,7 @@ set dt_submit= ,dt_start=null, dt_finish=null, submit_result='0' where instance_operation_uid= - - + @@ -254,8 +256,7 @@ - - + @@ -304,5 +305,17 @@ + + + + + + select contragent_code + from contragent + where contragent_id= + + + + \ No newline at end of file diff --git a/v1/resources/notification_ls.cfc b/v1/resources/notification_ls.cfc index 2c45763..34cf1b0 100644 --- a/v1/resources/notification_ls.cfc +++ b/v1/resources/notification_ls.cfc @@ -7,10 +7,14 @@ @@ -53,6 +57,8 @@ n.notification_uid::text as notification_uid n.notification n.descr + n.url + n.timeout_sec n.contragent_id k.external_uid @@ -69,8 +75,9 @@ AND (k.external_uid = OR n.contragent_id IS NULL) order by dt_show_from desc - --limit #maxrows# - + limit #maxrows# + +