Added backend support for RTF Labeling

This commit is contained in:
Infineon\Ouellette
2025-01-16 23:18:31 -07:00
committed by Ouellette Jonathan (CSC FI SPS MESLEO)
parent 9f3dfbfe12
commit 9673fffee1
2 changed files with 71 additions and 1 deletions

View File

@ -38,7 +38,7 @@ Function Returntofab_API(@API)
#pragma precomp SRP_PreCompiler
Declare function OI_Wizard_Services, Return_To_Fab_Services, Database_Services
Declare function OI_Wizard_Services, Return_To_Fab_Services, Database_Services, Labeling_Services
Declare subroutine Return_To_Fab_Services
$insert APP_INSERTS
@ -367,3 +367,38 @@ CreateResultOptionCollection:
end
return
API returntofab.getreturntofablabelzpl.HEAD
API returntofab.getreturntofablabelzpl.GET
OIWizardID = ''
Cookies = HTTP_Services('GetHTTPCookie')
For each Cookie in Cookies using ';'
Key = Field(Cookie, '=', 1)
If Key EQ 'sessionID' then
OIWizardID = Field(Cookie, '=', 2)
end
Next Cookie
ValidSession = OI_Wizard_Services('ValidateSession', OIWizardID)
If ValidSession then
// Check if payload has the required information to create a react mode change record
RTFId = HTTP_Services('GetQueryField', 'ReturnToFabId')
If RTFId NE '' then
// The POST string will have been encoded so use percent (URL) decoding.
//Reactor_Services('CreateReactModeChange', UserID, ReactNo, Mode, ModeSubCat, ModeText)
ZPLString = Labeling_Services('GetReturnToFabLabelZPL', RTFId)
If Error_Services('NoError') And ZPLString NE '' then
// Maybe return the corresponding reactor object with the new current mode info.
HTTP_Services('SetResponseStatus', 201, ZPLString)
end else
HTTP_Services('SetResponseStatus', 400, Error_Services('GetMessage'))
end
end else
HTTP_Services('SetResponseStatus', 400, 'RTFId was null')
end
end else
HTTP_Services('SetResponseStatus', 401, 'Invalid session. Reauthentication required.')
end
end api