Implemented ReceiveRelease_API.
Added OI Wizard Webview form to launch into OI Wizard from OI and auto-login the user. Added menu items to NDW_MAIN to launch the OI Wizard webview form and navigated to the appropriate page.
This commit is contained in:
@ -35,16 +35,15 @@ Function Wo_API(@API)
|
||||
10/20/23 xxx Original programmer.
|
||||
|
||||
***********************************************************************************************************************/
|
||||
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function Environment_Services, SRP_Datetime, Logging_Services, Work_Order_Services
|
||||
Declare Subroutine Btree.Extract, Logging_Services, Http_Services
|
||||
|
||||
$insert APP_INSERTS
|
||||
$insert API_SETUP
|
||||
$insert HTTP_INSERTS
|
||||
|
||||
Declare function Environment_Services, SRP_Datetime, Logging_Services, Work_Order_Services
|
||||
Declare Subroutine Btree.Extract, Logging_Services, Http_Services
|
||||
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\API\Materials\WO'
|
||||
@ -55,6 +54,8 @@ LoggingDTM = LogDate : ' ' : LogTime
|
||||
ResponseCode = ''
|
||||
ResponseMessage = ''
|
||||
LogData = ''
|
||||
Response = ''
|
||||
|
||||
GoToAPI else
|
||||
// The specific resource endpoint doesn't have a API handler yet.
|
||||
ResponseCode = 204
|
||||
@ -76,14 +77,6 @@ Return Response OR ''
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
API wo.HEAD
|
||||
API wo.GET
|
||||
|
||||
HTTP_Resource_Services('LoremIpsum')
|
||||
|
||||
end api
|
||||
|
||||
|
||||
API wo.ID.HEAD
|
||||
API wo.ID.GET
|
||||
|
||||
@ -91,7 +84,20 @@ API wo.ID.GET
|
||||
|
||||
end api
|
||||
|
||||
|
||||
API wo.ID.zpl.HEAD
|
||||
API wo.ID.zpl.GET
|
||||
|
||||
GoSub CreateZPLItem
|
||||
|
||||
end api
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CreateHALItem:
|
||||
|
||||
ResponseCode = 200
|
||||
MaterialKey = EndpointSegment
|
||||
WOLogKey = ''
|
||||
@ -122,7 +128,7 @@ CreateHALItem:
|
||||
|
||||
end
|
||||
IF WOLogKey NE '' then
|
||||
JSON = Work_Order_Services('ConvertRecordToJSON', WOLogKey, '', FullEndpointURL)
|
||||
JSON = Work_Order_Services('ConvertRecordToJSON', WOLogKey, '', FullEndpointURL)
|
||||
end else
|
||||
IF ResponseCode NE 500 then
|
||||
ResponseCode = 406
|
||||
@ -148,4 +154,32 @@ CreateHALItem:
|
||||
Message = Error_Services('GetMessage')
|
||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
// CreateZPLItem
|
||||
//
|
||||
// Creates a HAL+JSON object with the ZPL for the given WM_IN row
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
CreateZPLItem:
|
||||
|
||||
WoLogKey = ParentSegment
|
||||
ZPL = Work_Order_Services('GetWoLogZpl', WoLogKey)
|
||||
|
||||
If Error_Services('NoError') then
|
||||
StatusCode = 200
|
||||
HTTP_Services('SetResponseHeaderField', 'Content-Location', FullEndpointURL)
|
||||
HTTP_Services('SetResponseBody', ZPL, False$, 'text/plain')
|
||||
If Assigned(Message) then
|
||||
HTTP_Services('SetResponseStatus', StatusCode, Message)
|
||||
end else
|
||||
HTTP_Services('SetResponseStatus', StatusCode)
|
||||
end
|
||||
end else
|
||||
Message = Error_Services('GetMessage')
|
||||
HTTP_Services('SetResponseStatus', 500, 'Error in the ' : CurrentAPI : ' API. Message: ': Message)
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user