036 left join for json, exceptions
This commit is contained in:
+4
-2
@@ -108,10 +108,12 @@
|
|||||||
<cfset request.GUEST_USR_ID=3/> --->
|
<cfset request.GUEST_USR_ID=3/> --->
|
||||||
|
|
||||||
<!--- global settings --->
|
<!--- global settings --->
|
||||||
<cfset request.RECORDS_PER_PAGE=500/>
|
<!--- *************************************************************************************************************** --->
|
||||||
<cfset request.APP_VERSION="0.00.035"/>
|
<cfset request.APP_VERSION="0.00.036"/><!--- ************************************************************************ --->
|
||||||
|
<!--- *************************************************************************************************************** --->
|
||||||
<cfheader name="X-Application-Version" value=#request.APP_VERSION#/>
|
<cfheader name="X-Application-Version" value=#request.APP_VERSION#/>
|
||||||
<cfset request.STAND=getStand()/>
|
<cfset request.STAND=getStand()/>
|
||||||
|
<cfset request.RECORDS_PER_PAGE=500/>
|
||||||
|
|
||||||
<!--- application constants --->
|
<!--- application constants --->
|
||||||
|
|
||||||
|
|||||||
@@ -38,31 +38,59 @@ function gaussianRound(numeric number, numeric precision = 0) {
|
|||||||
</cffunction>
|
</cffunction>
|
||||||
|
|
||||||
|
|
||||||
<cfmodule template="mod/compute_payg.cfm"
|
<cfif listFind(request.auth.wz,"WZ01112")>
|
||||||
dt_finish=#dt_finish#
|
|
||||||
dt_start=#dt_start#
|
<cfset temp.out=[
|
||||||
tenant_wz_index=#tenant_wz_index#
|
"status"="exception"
|
||||||
output="report"
|
,"message"="Для провайдера отчетность по потреблению не отображается."
|
||||||
debug=#isDefined("DEBUG")#
|
,"tenantWzIndex"="#tenant_wz_index#"
|
||||||
/>
|
,"wz"=#request.auth.wz#
|
||||||
<!--- "dtStart"="#dateFormat(dt_start, "yyyy-mm-dd")#"
|
,"login"=#request.auth.login#
|
||||||
,"dtFinish"="#dateFormat(dt_finish, "yyyy-mm-dd")#" --->
|
,"appVersion"=#request.APP_VERSION#
|
||||||
<cfset temp.out=[
|
,"queryDurationMs"=#(getTickCount() - msStartAt)#
|
||||||
"dtStart="=#iso8601dtFormat(dt_start)#
|
]/>
|
||||||
,"dtFinish"=#iso8601dtFormat(dt_finish)#
|
|
||||||
,"hours"=#hours#
|
<cfelseif listFind(request.auth.wz,"WZ01553")>
|
||||||
,"tenantWzIndex"="#tenant_wz_index#"
|
|
||||||
,"wz"=#request.auth.wz#
|
<cfset temp.out=[
|
||||||
,"login"=#request.auth.login#
|
"status"="exception"
|
||||||
,"appVersion"=#request.APP_VERSION#
|
,"message"="Отображение актуальных данных по потреблению временно недоступно. Обратитесь к сервис-мененджеру. Извините за доставленные неудобства."
|
||||||
,"vcdComputingLoadedAt"="#iso8601dtFormat(report.qComputingAge.dt_load)#"
|
,"tenantWzIndex"="#tenant_wz_index#"
|
||||||
,"vcdStorageLoadedAt"="#iso8601dtFormat(report.qStorageAge.dt_load)#"
|
,"wz"=#request.auth.wz#
|
||||||
,"s3StorageLoadedAt"="#iso8601dtFormat(report.qComputingAge.dt_load)#"
|
,"login"=#request.auth.login#
|
||||||
,"s3OpsTrfLoadedAt"="#iso8601dtFormat(report.qS3OpsTrfAge.dt_load)#"
|
,"appVersion"=#request.APP_VERSION#
|
||||||
,"records"=#report.qCharge.recordCount#
|
,"queryDurationMs"=#(getTickCount() - msStartAt)#
|
||||||
,"queryDurationMs"=#(getTickCount() - msStartAt)#
|
]/>
|
||||||
,"periods"=[]
|
|
||||||
]/><!--- using [] instead of {} for struct literals to obtain linked (ordered) structures: keys order preserved --->
|
<cfelse>
|
||||||
|
|
||||||
|
<cfmodule template="mod/compute_payg.cfm"
|
||||||
|
dt_finish=#dt_finish#
|
||||||
|
dt_start=#dt_start#
|
||||||
|
tenant_wz_index=#tenant_wz_index#
|
||||||
|
full_join=false
|
||||||
|
output="report"
|
||||||
|
debug=#isDefined("DEBUG")#
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<cfset temp.out=[
|
||||||
|
"status"="success"
|
||||||
|
,"dtStart"=#iso8601dtFormat(dt_start)#
|
||||||
|
,"dtFinish"=#iso8601dtFormat(dt_finish)#
|
||||||
|
,"hours"=#hours#
|
||||||
|
,"tenantWzIndex"="#tenant_wz_index#"
|
||||||
|
,"wz"=#request.auth.wz#
|
||||||
|
,"login"=#request.auth.login#
|
||||||
|
,"appVersion"=#request.APP_VERSION#
|
||||||
|
,"vcdComputingLoadedAt"="#iso8601dtFormat(report.qComputingAge.dt_load)#"
|
||||||
|
,"vcdStorageLoadedAt"="#iso8601dtFormat(report.qStorageAge.dt_load)#"
|
||||||
|
,"s3StorageLoadedAt"="#iso8601dtFormat(report.qComputingAge.dt_load)#"
|
||||||
|
,"s3OpsTrfLoadedAt"="#iso8601dtFormat(report.qS3OpsTrfAge.dt_load)#"
|
||||||
|
,"records"=#report.qCharge.recordCount#
|
||||||
|
,"queryDurationMs"=#(getTickCount() - msStartAt)#
|
||||||
|
,"periods"=[]
|
||||||
|
]/><!--- using [] instead of {} for struct literals to obtain linked (ordered) structures: keys order preserved --->
|
||||||
<!--- beware nulls --->
|
<!--- beware nulls --->
|
||||||
<cfoutput query="report.qCharge" group="year">
|
<cfoutput query="report.qCharge" group="year">
|
||||||
<cfoutput group="month">
|
<cfoutput group="month">
|
||||||
@@ -137,6 +165,9 @@ function gaussianRound(numeric number, numeric precision = 0) {
|
|||||||
</cfoutput><!--- month --->
|
</cfoutput><!--- month --->
|
||||||
</cfoutput><!--- year --->
|
</cfoutput><!--- year --->
|
||||||
<cfset "temp.out.durationMs"=(getTickCount()-request.startTickCount)/>
|
<cfset "temp.out.durationMs"=(getTickCount()-request.startTickCount)/>
|
||||||
|
|
||||||
|
</cfif>
|
||||||
|
|
||||||
<cfcontent
|
<cfcontent
|
||||||
type="application/json"
|
type="application/json"
|
||||||
/><cfoutput>#serializeJSON(temp.out)#</cfoutput>
|
/><cfoutput>#serializeJSON(temp.out)#</cfoutput>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<cfparam name="ATTRIBUTES.debug" type="boolean" default=false/>
|
<cfparam name="ATTRIBUTES.debug" type="boolean" default=false/>
|
||||||
<cfparam name="ATTRIBUTES.tenant_wz_index" type="string"/>
|
<cfparam name="ATTRIBUTES.tenant_wz_index" type="string"/>
|
||||||
<cfparam name="ATTRIBUTES.restrict_to_own_instances" type="boolean" default=true/>
|
<cfparam name="ATTRIBUTES.restrict_to_own_instances" type="boolean" default=true/>
|
||||||
|
<cfparam name="ATTRIBUTES.full_join" type="boolean" default=true/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -444,7 +445,12 @@ from a
|
|||||||
<d:field>m.dimension_2_name</d:field>
|
<d:field>m.dimension_2_name</d:field>
|
||||||
</d:field_set>
|
</d:field_set>
|
||||||
FROM qSpec s
|
FROM qSpec s
|
||||||
FULL OUTER JOIN qUnifiedMetric m ON (
|
<cfif attributes.full_join>
|
||||||
|
FULL OUTER JOIN
|
||||||
|
<cfelse>
|
||||||
|
LEFT OUTER JOIN
|
||||||
|
</cfif>
|
||||||
|
qUnifiedMetric m ON (
|
||||||
s.sku_code=m.code
|
s.sku_code=m.code
|
||||||
AND s.serviceStart <= m.dt
|
AND s.serviceStart <= m.dt
|
||||||
AND (m.dt <= s.serviceEnd OR s.serviceEnd IS NULL)
|
AND (m.dt <= s.serviceEnd OR s.serviceEnd IS NULL)
|
||||||
|
|||||||
@@ -22,10 +22,12 @@
|
|||||||
<cfset tenant_wz_index=val(mid(WZ,3,5))/><!--- cut off WZ --->
|
<cfset tenant_wz_index=val(mid(WZ,3,5))/><!--- cut off WZ --->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<cfif isDefined("output_xls")><cfmodule template="mod/compute_payg.cfm"
|
<cfif isDefined("output_xls")><cfmodule template="mod/compute_payg.cfm"
|
||||||
dt_finish=#dt_finish#
|
dt_finish=#dt_finish#
|
||||||
dt_start=#dt_start#
|
dt_start=#dt_start#
|
||||||
tenant_wz_index=#tenant_wz_index#
|
tenant_wz_index=#tenant_wz_index#
|
||||||
|
full_join=true
|
||||||
output="report"
|
output="report"
|
||||||
debug=#isDefined("DEBUG")#
|
debug=#isDefined("DEBUG")#
|
||||||
restrict_to_own_instances=#restrict_to_own_instances#
|
restrict_to_own_instances=#restrict_to_own_instances#
|
||||||
@@ -36,6 +38,7 @@
|
|||||||
dt_finish=#dt_finish#
|
dt_finish=#dt_finish#
|
||||||
dt_start=#dt_start#
|
dt_start=#dt_start#
|
||||||
tenant_wz_index=#tenant_wz_index#
|
tenant_wz_index=#tenant_wz_index#
|
||||||
|
full_join=true
|
||||||
output="report"
|
output="report"
|
||||||
debug=#isDefined("DEBUG")#
|
debug=#isDefined("DEBUG")#
|
||||||
restrict_to_own_instances=#restrict_to_own_instances#
|
restrict_to_own_instances=#restrict_to_own_instances#
|
||||||
|
|||||||
Reference in New Issue
Block a user