082 availableResourceRealms

This commit is contained in:
msyu
2025-04-07 22:29:03 +03:00
parent 498abdc060
commit 9692b6c101
7 changed files with 153 additions and 10 deletions
+24
View File
@@ -130,6 +130,25 @@
null=#!isValid('integer',local.qInstanceOperation.svc_operation_id)#/>
order by sop.sort, sop.svc_operation_cfs_param_id
</cfquery>
<cfquery name="local.qAvailableResourceRealm" result="local.result">
select
<m:field_set titleMapOut="local.realmTitleMap" lengthOut="local.realmFieldCount">
<m:field>r.resource_realm_id</m:field>
<m:field>r.resource_realm_type_id</m:field>
<m:field>r.resource_realm</m:field>
</m:field_set>
from resource_realm r
join resource_realm_type t on (r.resource_realm_type_id=t.resource_realm_type_id)
/*left outer join resource_realm p on (r.parent_id=p.resource_realm_id)*/
join resource_realm_access a on
(r.resource_realm_id=a.resource_realm_id
AND a.contract_id=<cfqueryparam cfsqltype="CF_SQL_INTEGER" value=#arguments.contractId#/>
AND a.is_enabled)
join svc s on r.resource_realm_type_id=s.resource_realm_type_id
where s.svc_id=<cfqueryparam cfsqltype="CF_SQL_INTEGER" value=#local.qInstanceOperation.service_id#/>
order by 1
</cfquery>
<cfset "out.queryDurationMs"=getTickCount() - request.startTickCount/>
@@ -149,6 +168,11 @@
<cfset "out.instanceOperation.state"=(local.qState.recordCount GT 0) ? this.helper.appendRecord(structNew("linked"), "", local.stateTitleMap, local.qState, this.helper.snake2camel) : {}/>
<cfset "out.instanceOperation.availableResourceRealms"=[]/>
<cfloop query=#local.qAvailableResourceRealm#>
<cfset arrayAppend(out.instanceOperation.availableResourceRealms, this.helper.appendRecord(structNew("linked"), "", local.realmTitleMap, local.qAvailableResourceRealm, this.helper.snake2camel))/>
</cfloop>
<cfset "out.runDurationMs"=getTickCount() - request.startTickCount/>
<cfreturn representationOf(out) />
</cffunction>