036 left join for json, exceptions
This commit is contained in:
+4
-2
@@ -108,10 +108,12 @@
|
||||
<cfset request.GUEST_USR_ID=3/> --->
|
||||
|
||||
<!--- 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#/>
|
||||
<cfset request.STAND=getStand()/>
|
||||
<cfset request.RECORDS_PER_PAGE=500/>
|
||||
|
||||
<!--- application constants --->
|
||||
|
||||
|
||||
@@ -38,31 +38,59 @@ function gaussianRound(numeric number, numeric precision = 0) {
|
||||
</cffunction>
|
||||
|
||||
|
||||
<cfmodule template="mod/compute_payg.cfm"
|
||||
dt_finish=#dt_finish#
|
||||
dt_start=#dt_start#
|
||||
tenant_wz_index=#tenant_wz_index#
|
||||
output="report"
|
||||
debug=#isDefined("DEBUG")#
|
||||
/>
|
||||
<!--- "dtStart"="#dateFormat(dt_start, "yyyy-mm-dd")#"
|
||||
,"dtFinish"="#dateFormat(dt_finish, "yyyy-mm-dd")#" --->
|
||||
<cfset temp.out=[
|
||||
"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 --->
|
||||
<cfif listFind(request.auth.wz,"WZ01112")>
|
||||
|
||||
<cfset temp.out=[
|
||||
"status"="exception"
|
||||
,"message"="Для провайдера отчетность по потреблению не отображается."
|
||||
,"tenantWzIndex"="#tenant_wz_index#"
|
||||
,"wz"=#request.auth.wz#
|
||||
,"login"=#request.auth.login#
|
||||
,"appVersion"=#request.APP_VERSION#
|
||||
,"queryDurationMs"=#(getTickCount() - msStartAt)#
|
||||
]/>
|
||||
|
||||
<cfelseif listFind(request.auth.wz,"WZ01553")>
|
||||
|
||||
<cfset temp.out=[
|
||||
"status"="exception"
|
||||
,"message"="Отображение актуальных данных по потреблению временно недоступно. Обратитесь к сервис-мененджеру. Извините за доставленные неудобства."
|
||||
,"tenantWzIndex"="#tenant_wz_index#"
|
||||
,"wz"=#request.auth.wz#
|
||||
,"login"=#request.auth.login#
|
||||
,"appVersion"=#request.APP_VERSION#
|
||||
,"queryDurationMs"=#(getTickCount() - msStartAt)#
|
||||
]/>
|
||||
|
||||
<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 --->
|
||||
<cfoutput query="report.qCharge" group="year">
|
||||
<cfoutput group="month">
|
||||
@@ -137,6 +165,9 @@ function gaussianRound(numeric number, numeric precision = 0) {
|
||||
</cfoutput><!--- month --->
|
||||
</cfoutput><!--- year --->
|
||||
<cfset "temp.out.durationMs"=(getTickCount()-request.startTickCount)/>
|
||||
|
||||
</cfif>
|
||||
|
||||
<cfcontent
|
||||
type="application/json"
|
||||
/><cfoutput>#serializeJSON(temp.out)#</cfoutput>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<cfparam name="ATTRIBUTES.debug" type="boolean" default=false/>
|
||||
<cfparam name="ATTRIBUTES.tenant_wz_index" type="string"/>
|
||||
<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_set>
|
||||
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
|
||||
AND s.serviceStart <= m.dt
|
||||
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 --->
|
||||
|
||||
|
||||
|
||||
<cfif isDefined("output_xls")><cfmodule template="mod/compute_payg.cfm"
|
||||
dt_finish=#dt_finish#
|
||||
dt_start=#dt_start#
|
||||
tenant_wz_index=#tenant_wz_index#
|
||||
full_join=true
|
||||
output="report"
|
||||
debug=#isDefined("DEBUG")#
|
||||
restrict_to_own_instances=#restrict_to_own_instances#
|
||||
@@ -36,6 +38,7 @@
|
||||
dt_finish=#dt_finish#
|
||||
dt_start=#dt_start#
|
||||
tenant_wz_index=#tenant_wz_index#
|
||||
full_join=true
|
||||
output="report"
|
||||
debug=#isDefined("DEBUG")#
|
||||
restrict_to_own_instances=#restrict_to_own_instances#
|
||||
|
||||
Reference in New Issue
Block a user