190 wz fix, instance fix
This commit is contained in:
+12
-3
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
//variables.framework.docs={};
|
//variables.framework.docs={};
|
||||||
variables.framework.docs.APIName="svc-api";
|
variables.framework.docs.APIName="svc-api";
|
||||||
variables.framework.docs.APIVersion="0.189"; /*$ git config --global --unset user.password*/
|
variables.framework.docs.APIVersion="0.190"; /*$ git config --global --unset user.password*/
|
||||||
|
|
||||||
variables.framework.globalHeaders = structNew();
|
variables.framework.globalHeaders = structNew();
|
||||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||||
@@ -321,13 +321,22 @@
|
|||||||
arguments.requestArguments.contragentId=usrCustomerInfo.contragentId; //Integer
|
arguments.requestArguments.contragentId=usrCustomerInfo.contragentId; //Integer
|
||||||
arguments.requestArguments.contractId=usrCustomerInfo.contractId; //Integer
|
arguments.requestArguments.contractId=usrCustomerInfo.contractId; //Integer
|
||||||
arguments.requestArguments.specificationId=usrCustomerInfo.specificationId; //Integer
|
arguments.requestArguments.specificationId=usrCustomerInfo.specificationId; //Integer
|
||||||
|
|
||||||
try {
|
try {
|
||||||
arguments.requestArguments.isImpersonated=usrCustomerInfo.impersonation.is_impersonated;
|
arguments.requestArguments.isImpersonated=usrCustomerInfo.impersonation.is_impersonated;
|
||||||
arguments.requestArguments.clientID=usrCustomerInfo.clientID;
|
|
||||||
arguments.requestArguments.login=usrCustomerInfo.login;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
arguments.requestArguments.isImpersonated=false; // так себе решение, надо было бы NULL
|
arguments.requestArguments.isImpersonated=false; // так себе решение, надо было бы NULL
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
arguments.requestArguments.clientID=usrCustomerInfo.clientID;
|
||||||
|
} catch (e) {
|
||||||
arguments.requestArguments.clientID="";
|
arguments.requestArguments.clientID="";
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
arguments.requestArguments.login=usrCustomerInfo.login;
|
||||||
|
} catch (e) {
|
||||||
arguments.requestArguments.login="";
|
arguments.requestArguments.login="";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -291,6 +291,8 @@
|
|||||||
<!--- ---------------------------------------------------------------------------------- --->
|
<!--- ---------------------------------------------------------------------------------- --->
|
||||||
<!--- маскируем секреты *** это не очень похоже на то же самое в списке, там мы просто удаляем параметры --->
|
<!--- маскируем секреты *** это не очень похоже на то же самое в списке, там мы просто удаляем параметры --->
|
||||||
<!--- *** подгоняем запрос под структуру из instance_operation_cfs_param --->
|
<!--- *** подгоняем запрос под структуру из instance_operation_cfs_param --->
|
||||||
|
<!--- а мы тут упускаем, что может быть несколько операций create, как правило из-за сломавшихся. Но параметры мы берем из текущего стейта, и операцию возьмем оттуда же --->
|
||||||
|
|
||||||
<cfquery name="local.qCfsParam" result="local.result">
|
<cfquery name="local.qCfsParam" result="local.result">
|
||||||
select
|
select
|
||||||
p.svc_operation_cfs_param
|
p.svc_operation_cfs_param
|
||||||
@@ -304,7 +306,10 @@
|
|||||||
join svc_operation_cfs_param sop on (iop.svc_operation_cfs_param_id=sop.svc_operation_cfs_param_id)
|
join svc_operation_cfs_param sop on (iop.svc_operation_cfs_param_id=sop.svc_operation_cfs_param_id)
|
||||||
join instance_operation io on (iop.instance_operation_uid=io.instance_operation_uid)
|
join instance_operation io on (iop.instance_operation_uid=io.instance_operation_uid)
|
||||||
where sop.svc_operation_cfs_param_id=p.svc_operation_cfs_param_id AND
|
where sop.svc_operation_cfs_param_id=p.svc_operation_cfs_param_id AND
|
||||||
io.instance_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceUid#" null=#!isValid('guid',arguments.instanceUid)#/>)
|
io.instance_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#arguments.instanceUid#" null=#!isValid('guid',arguments.instanceUid)#/> <!--- уже лишнее ---> AND
|
||||||
|
io.instance_operation_uid=<cfqueryparam cfsqltype="cf_sql_other" value="#local.qCurrentState.instance_operation_uid#" null=#!isValid('guid',local.qCurrentState.instance_operation_uid)#/>
|
||||||
|
--limit 1 <!--- *** hotfix --->
|
||||||
|
)
|
||||||
from svc_operation_cfs_param p
|
from svc_operation_cfs_param p
|
||||||
join svc_operation o on (p.svc_operation_id=o.svc_operation_id)
|
join svc_operation o on (p.svc_operation_id=o.svc_operation_id)
|
||||||
join svc on (o.svc_id=svc.svc_id)
|
join svc on (o.svc_id=svc.svc_id)
|
||||||
|
|||||||
@@ -213,7 +213,8 @@ arguments.requestArguments.specificationId=usrCustomerInfo.specificationId; //In
|
|||||||
from svc_operation_cfs_param sop
|
from svc_operation_cfs_param sop
|
||||||
join svc_operation so on (sop.svc_operation_id=so.svc_operation_id)
|
join svc_operation so on (sop.svc_operation_id=so.svc_operation_id)
|
||||||
where sop.svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.svcOperationCfsParamId#"/>
|
where sop.svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.svcOperationCfsParamId#"/>
|
||||||
</cfquery>
|
</cfquery>
|
||||||
|
|
||||||
<cfif local.qInstanceService.specification_id NEQ arguments.specificationId>
|
<cfif local.qInstanceService.specification_id NEQ arguments.specificationId>
|
||||||
<cfreturn representationOf(this.helper.formatMessage("Instance not accessible", "Instance does not belong to the current specification, contract or contragent")).withStatus(403)/>
|
<cfreturn representationOf(this.helper.formatMessage("Instance not accessible", "Instance does not belong to the current specification, contract or contragent")).withStatus(403)/>
|
||||||
</cfif>
|
</cfif>
|
||||||
@@ -222,7 +223,7 @@ arguments.requestArguments.specificationId=usrCustomerInfo.specificationId; //In
|
|||||||
</cfif>
|
</cfif>
|
||||||
<cfif local.qInstanceService.operation NEQ local.qTemplateSvc.operation>
|
<cfif local.qInstanceService.operation NEQ local.qTemplateSvc.operation>
|
||||||
<cfreturn representationOf(this.helper.formatMessage("Invalid CFS parameter", "Parameter specified does not belong to this operation")).withStatus(400)/>
|
<cfreturn representationOf(this.helper.formatMessage("Invalid CFS parameter", "Parameter specified does not belong to this operation")).withStatus(400)/>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
<cfquery name="local.qSave">
|
<cfquery name="local.qSave">
|
||||||
insert into instance_operation_cfs_param (
|
insert into instance_operation_cfs_param (
|
||||||
|
|||||||
Reference in New Issue
Block a user