Enhanced Error Checking
This commit is contained in:
committed by
Ouellette Jonathan (CSC FI SPS MESLEO)
parent
09d2d13e63
commit
a8dff61cfa
@ -2379,26 +2379,35 @@ Service GetSLLReportJson(FromDt, ToDt)
|
||||
ErrorMessage = ''
|
||||
SLLReportJson = ''
|
||||
objSLLReportJson = ''
|
||||
If FromDt NE '' OR ToDt NE '' then
|
||||
If SRP_Json(objSLLReportJson, 'New', 'Array') then
|
||||
For StartDt = FromDt to ToDt
|
||||
ThisDate = Date_Services('ConvertDateTimeToISO8601', StartDt)
|
||||
ThisDtASMDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM')
|
||||
ThisDtASMPlusDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM+')
|
||||
ThisDtHTRDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'HTR')
|
||||
ThisDtASMDownLLCount = DCount(ThisDtASMDownLL, @VM) + DCount(ThisDtASMPlusDownLL, @VM)
|
||||
ThisDtHTRDownLLCount = DCount(ThisDtHTRDownLL, @VM)
|
||||
objSLLDay = ''
|
||||
If SRP_Json(objSLLDay, 'New', 'Object') then
|
||||
SRP_Json(objSLLDay, 'SetValue', 'Date', ThisDate)
|
||||
SRP_Json(objSLLDay, 'SetValue', 'ASM', ThisDtASMDownLLCount)
|
||||
SRP_Json(objSLLDay, 'SetValue', 'HTR', ThisDtHTRDownLLCount)
|
||||
SRP_Json(objSLLReportJson, 'Add', objSLLDay)
|
||||
SRP_Json(objSLLDay, 'Release')
|
||||
end
|
||||
Next StartDt
|
||||
SLLReportJson = SRP_Json(objSLLReportJson, 'Stringify', 'Fast')
|
||||
SRP_Json(objSLLReportJson, 'Release')
|
||||
end else
|
||||
ErrorMessage = 'Error creating the root JSON for the report.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'From Date or To Date was null.'
|
||||
end
|
||||
|
||||
If SRP_Json(objSLLReportJson, 'New', 'Array') then
|
||||
For StartDt = FromDt to ToDt
|
||||
ThisDate = Date_Services('ConvertDateTimeToISO8601', StartDt)
|
||||
ThisDtASMDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM')
|
||||
ThisDtASMPlusDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'ASM+')
|
||||
ThisDtHTRDownLL = Reactor_Services('GetReactorsWithDownLLByDtm', StartDt + 1, 'HTR')
|
||||
ThisDtASMDownLLCount = DCount(ThisDtASMDownLL, @VM) + DCount(ThisDtASMPlusDownLL, @VM)
|
||||
ThisDtHTRDownLLCount = DCount(ThisDtHTRDownLL, @VM)
|
||||
objSLLDay = ''
|
||||
If SRP_Json(objSLLDay, 'New', 'Object') then
|
||||
SRP_Json(objSLLDay, 'SetValue', 'Date', ThisDate)
|
||||
SRP_Json(objSLLDay, 'SetValue', 'ASM', ThisDtASMDownLLCount)
|
||||
SRP_Json(objSLLDay, 'SetValue', 'HTR', ThisDtHTRDownLLCount)
|
||||
SRP_Json(objSLLReportJson, 'Add', objSLLDay)
|
||||
SRP_Json(objSLLDay, 'Release')
|
||||
end
|
||||
Next StartDt
|
||||
SLLReportJson = SRP_Json(objSLLReportJson, 'Stringify', 'Fast')
|
||||
SRP_Json(objSLLReportJson, 'Release')
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
|
||||
Response = SLLReportJson
|
||||
|
Reference in New Issue
Block a user