refactored material track code for front end
This commit is contained in:
committed by
Stieber Daniel (CSC FI SPS MESLEO)
parent
c36cf5fedc
commit
d7d8fc0289
@ -78,6 +78,8 @@ API config.ID.PUT
|
||||
end
|
||||
If Key EQ 'userID' then
|
||||
CurrUser = Field(Cookie, '=', 2)
|
||||
end else
|
||||
If OIWizardID NE '' then CurrUser = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||
end
|
||||
Next Cookie
|
||||
|
||||
@ -109,7 +111,23 @@ CreateHALItem:
|
||||
|
||||
Begin Case
|
||||
Case ConfigID _EQC 'OEE'
|
||||
JSONResponse = Config_Services('GetOEE', FullEndpointURL)
|
||||
JSONResponse = Config_Services('GetOEE', FullEndpointURL)
|
||||
Case ConfigID _EQC 'MaterialTrack'
|
||||
OIWizardID = ''
|
||||
CurrUser = ''
|
||||
Cookies = HTTP_Services('GetHTTPCookie')
|
||||
For each Cookie in Cookies using ';'
|
||||
Key = Trim(Field(Cookie, '=', 1))
|
||||
If Key EQ 'sessionID' then
|
||||
OIWizardID = Field(Cookie, '=', 2)
|
||||
end
|
||||
If Key EQ 'userID' then
|
||||
CurrUser = Field(Cookie, '=', 2)
|
||||
end else
|
||||
If OIWizardID NE '' then CurrUser = Xlate('OI_WIZARD', OIWizardID, 'EMPLOYEE_ID', 'X')
|
||||
end
|
||||
Next Cookie
|
||||
JSONResponse = Config_Services('GetMaterialTrackSettings', CurrUser)
|
||||
Case Otherwise$
|
||||
Error_Services('Add', 'Unsupported configID')
|
||||
End Case
|
||||
@ -166,6 +184,17 @@ UpdateHALItem:
|
||||
end else
|
||||
Error_Services('Add', 'User is not authorized to update OEE setpoints.')
|
||||
end
|
||||
Case ConfigID _EQC 'MaterialTrack'
|
||||
// The resource will have been put into the POST string.
|
||||
Body = HTTP_Services('GetHTTPPostString')
|
||||
If Body NE '' then
|
||||
// The POST string will have been encoded so use percent (URL) decoding.
|
||||
MtSettingsJson = HTTP_Services('DecodePercentString', Body)
|
||||
Config_Services('UpdateMaterialTrackSettings', MtSettingsJson, CurrUser)
|
||||
end else
|
||||
Error_Services('Add', 'No body was sent with the request.')
|
||||
end
|
||||
|
||||
Case Otherwise$
|
||||
Error_Services('Add', 'Unsupported configID')
|
||||
End Case
|
||||
@ -184,3 +213,4 @@ UpdateHALItem:
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user