Added in notifications to desired steps. Made a change to OI Wizard Authentication methods to use a server rather than a calculated column.
This commit is contained in:
parent
a269f2f6cf
commit
585f54f547
@ -6,7 +6,7 @@ $insert OI_WIZARD_TRANSACTIONS_EQUATES
|
||||
$Insert REACT_MODE_NG_EQUATES
|
||||
|
||||
Declare function RTI_CreateGUID, Database_Services, Error_Services, SRP_Json, MemberOf
|
||||
Declare function OI_Wizard_Services, Reactor_Services, Reactor_Modes_Services
|
||||
Declare function OI_Wizard_Services, Reactor_Services, Reactor_Modes_Services, Datetime
|
||||
Declare subroutine Database_Services, Error_Services, SRP_Json, Service_Services
|
||||
|
||||
GoToService
|
||||
@ -186,17 +186,30 @@ end service
|
||||
Service ValidateSession(OIWizardID)
|
||||
ErrorMsg = ''
|
||||
If OIWizardID NE '' then
|
||||
OIWizardRec = Database_Services('ReadDataRow', 'OI_WIZARD', OIWizardID)
|
||||
OIWizardRec = Database_Services('ReadDataRow', 'OI_WIZARD', OIWizardID, True$, 0, False$)
|
||||
If Error_Services('NoError') then
|
||||
ValidSession = Xlate('OI_WIZARD', OIWizardID, 'VALID', 'X')
|
||||
If ValidSession then
|
||||
// Set session updated time and date to extend session life.
|
||||
OIWizardRec<OI_WIZARD.UPDATED_DATES$, -1> = Date()
|
||||
OIWizardRec<OI_WIZARD.UPDATED_TIMES$, -1> = Time()
|
||||
Database_Services('WriteDataRow', 'OI_WIZARD', OIWizardID, OIWizardRec)
|
||||
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||
SessionTerminated = OIWizardRec<OI_WIZARD.TERMINATED$>
|
||||
if Not(SessionTerminated) then
|
||||
LastDate = OIWizardRec<OI_WIZARD.UPDATED_DATES$>[-1, 'B' : @VM]
|
||||
LastTime = OIWizardRec<OI_WIZARD.UPDATED_TIMES$>[-1, 'B' : @VM]
|
||||
If LastDate EQ '' then
|
||||
// No updates have occured so use the Create Date/Time.
|
||||
LastDate = OIWizardRec<OI_WIZARD.CREATED_DATE$>
|
||||
LastTime = OIWizardRec<OI_WIZARD.CREATED_TIME$>
|
||||
end
|
||||
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
||||
SessionAge = (Datetime() - lastDateTime) * 86400
|
||||
// 600 seconds = 10 minutes
|
||||
If SessionAge LT 600 then
|
||||
OIWizardRec<OI_WIZARD.UPDATED_DATES$, -1> = Date()
|
||||
OIWizardRec<OI_WIZARD.UPDATED_TIMES$, -1> = Time()
|
||||
Database_Services('WriteDataRow', 'OI_WIZARD', OIWizardID, OIWizardRec)
|
||||
If Error_Services('HasError') then ErrorMsg = Error_Services('GetMessage')
|
||||
end else
|
||||
ErrorMsg = 'Session has expired'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Expired session.'
|
||||
ErrorMsg = 'Session has been previously terminated.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
@ -211,18 +224,37 @@ Service ValidateSession(OIWizardID)
|
||||
Error_Services('Add', ErrorMsg)
|
||||
Response = False$
|
||||
end
|
||||
|
||||
end service
|
||||
/*
|
||||
This routine validates a users session without extending it. Used for OI Wizard sessions that are awaiting input.
|
||||
*/
|
||||
Service ValidateSessionIdle(OIWizardID)
|
||||
|
||||
ErrorMsg = ''
|
||||
If OIWizardID NE '' then
|
||||
Valid = Xlate('OI_WIZARD', OIWizardID, 'VALID', 'X')
|
||||
If Not(Valid) then
|
||||
ErrorMsg = 'Invalid or expired session'
|
||||
OIWizardRec = Database_Services('ReadDataRow', 'OI_WIZARD', OIWizardID, True$, 0, False$)
|
||||
If Error_Services('NoError') then
|
||||
SessionTerminated = OIWizardRec<OI_WIZARD.TERMINATED$>
|
||||
if Not(SessionTerminated) then
|
||||
LastDate = OIWizardRec<OI_WIZARD.UPDATED_DATES$>[-1, 'B' : @VM]
|
||||
LastTime = OIWizardRec<OI_WIZARD.UPDATED_TIMES$>[-1, 'B' : @VM]
|
||||
If LastDate EQ '' then
|
||||
// No updates have occured so use the Create Date/Time.
|
||||
LastDate = OIWizardRec<OI_WIZARD.CREATED_DATE$>
|
||||
LastTime = OIWizardRec<OI_WIZARD.CREATED_TIME$>
|
||||
end
|
||||
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
||||
SessionAge = (Datetime() - lastDateTime) * 86400
|
||||
// 600 seconds = 10 minutes
|
||||
If SessionAge GE 600 then
|
||||
ErrorMsg = 'Session has expired'
|
||||
end else
|
||||
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Session has been previously terminated.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error in ':Service:' service. Null OIWizardID passed in.'
|
||||
@ -231,7 +263,6 @@ Service ValidateSessionIdle(OIWizardID)
|
||||
If ErrorMsg EQ '' then
|
||||
Response = True$
|
||||
end else
|
||||
debug
|
||||
Error_Services('Add', ErrorMsg)
|
||||
Response = False$
|
||||
end
|
||||
|
@ -5,6 +5,7 @@ Declare subroutine Error_Services, Database_Services, Btree.Extract, Logging_Ser
|
||||
|
||||
Declare function Rti_Createguid, Database_Services, Return_To_Fab_Services, Datetime, Error_Services
|
||||
Declare function Logging_Services, Environment_Services, SRP_JSON
|
||||
Declare subroutine obj_notes
|
||||
|
||||
$insert LOGICAL
|
||||
$Insert APP_INSERTS
|
||||
@ -12,6 +13,7 @@ $Insert RETURN_TO_FAB_LOTS_EQUATES
|
||||
$Insert RETURN_TO_FAB_RESULT_OPTION_EQUATES
|
||||
$Insert WO_MAT_EQUATES
|
||||
$Insert RDS_EQUATES
|
||||
$Insert NOTIFICATION_EQUATES
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Return_To_Fab_Services'; //Define the directory where the log will be saved to. This happens the first time of the day that the log is written to.
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
@ -69,7 +71,23 @@ Service CreateReturnToFabRecord(CassId, UserId)
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_REQUESTOR_USER_ID$> = UserId
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_START_DTM$> = Datetime()
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$> = False$
|
||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', NewRTFId, RTFRecord, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', NewRTFId, RTFRecord, True$, False$, True$)
|
||||
If Error_Services('NoError') then
|
||||
//Send notification that a return to fab record was created.
|
||||
Message = 'Return to fab form created for ' : CassId : ' by ' : UserId : '.' : CRLF$
|
||||
Message := 'Link to Return To Fab form: https://goto.infineon.com/oiwizard/ReturnToFab'
|
||||
Recipients = XLATE('NOTIFICATION','SHIPPING',NOTIFICATION_USER_ID$,'X')
|
||||
Recipients<1, -1> = UserId
|
||||
SentFrom = 'OI_ADMIN'
|
||||
Subject = 'Return To Fab Form Created'
|
||||
SendToGroup = ''
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error creating return to fab record, Cassette ID is not currently in SAP and cannot be returned to fab.'
|
||||
end
|
||||
@ -419,9 +437,26 @@ Service SetBinToBin(RTFId, MHUserId)
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_USER_ID$> = MHUserId
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_MH_INIT_DTM$> = Datetime()
|
||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
If Error_Services('NoError') then
|
||||
//Send notification that a return to fab record was created.
|
||||
CassId = RTFRecord<RETURN_TO_FAB_LOTS_CASS_ID$>
|
||||
RTFOrigUser = RTFRecord<RETURN_TO_FAB_LOTS_REQUESTOR_USER_ID$>
|
||||
Message = 'Return to fab form updated for ' : CassId : ' by ' : RTFOrigUser : '.' : CRLF$
|
||||
Message := 'Initial Bin to Bin has been marked as completed.' : CRLF$
|
||||
Message := 'Link to Return To Fab form: https://goto.infineon.com/oiwizard/ReturnToFab'
|
||||
Recipients = XLATE('NOTIFICATION','SHIPPING',NOTIFICATION_USER_ID$,'X')
|
||||
|
||||
Recipients<1, -1> = RTFOrigUser
|
||||
SentFrom = 'OI_ADMIN'
|
||||
Subject = 'Return To Fab Form Updated'
|
||||
SendToGroup = ''
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error setting Initial SAP Bin-to-Bin. Material Handler User ID was not found in OpenInsight.'
|
||||
end
|
||||
@ -470,9 +505,25 @@ Service SetRTFCompleted(RTFId, CompleteUserId)
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED$> = True$
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_COMPLETED_DTM$> = Datetime()
|
||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
If Error_Services('NoError') then
|
||||
//Send notification that a return to fab record was created.
|
||||
CassId = RTFRecord<RETURN_TO_FAB_LOTS_CASS_ID$>
|
||||
RTFOrigUser = RTFRecord<RETURN_TO_FAB_LOTS_REQUESTOR_USER_ID$>
|
||||
Message = 'Return to fab form updated for ' : CassId : ' by ' : RTFOrigUser : '.' : CRLF$
|
||||
Message := 'Return to fab marked as completed.' : CRLF$
|
||||
Message := 'Link to Return To Fab form: https://goto.infineon.com/oiwizard/ReturnToFab'
|
||||
Recipients = XLATE('NOTIFICATION','SHIPPING',NOTIFICATION_USER_ID$,'X')
|
||||
Recipients<1, -1> = RTFRecord<RETURN_TO_FAB_LOTS_REQUESTOR_USER_ID$>
|
||||
SentFrom = 'OI_ADMIN'
|
||||
Subject = 'Return To Fab Form Completed'
|
||||
SendToGroup = ''
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error setting Return To Fab form as complete. User ID was not found in OpenInsight.'
|
||||
end
|
||||
@ -524,9 +575,26 @@ Service SetEvalInfo(RTFId, EvalUserId, ResultId)
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_EVAL_RESULT_ID$> = ResultId
|
||||
RTFRecord<RETURN_TO_FAB_LOTS_EVAL_DTM$> = Datetime()
|
||||
Database_Services('WriteDataRow', 'RETURN_TO_FAB_LOTS', RTFId, RTFRecord, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
If Error_Services('NoError') then
|
||||
ResultDescription = XLate('RETURN_TO_FAB_RESULT_OPTION', ResultId, RETURN_TO_FAB_RESULT_OPTION_RESULT$, 'X')
|
||||
//Send notification that a return to fab record was created.
|
||||
CassId = RTFRecord<RETURN_TO_FAB_LOTS_CASS_ID$>
|
||||
RTFOrigUser = RTFRecord<RETURN_TO_FAB_LOTS_REQUESTOR_USER_ID$>
|
||||
Message = 'Return to fab form updated for ' : CassId : ' by ' : RTFOrigUser : '.' : CRLF$
|
||||
Message := 'Result has been set to ' : ResultDescription : '.' : CRLF$
|
||||
Message := 'Link to Return To Fab form: https://goto.infineon.com/oiwizard/ReturnToFab'
|
||||
Recipients = XLATE('NOTIFICATION','SHIPPING',NOTIFICATION_USER_ID$,'X')
|
||||
Recipients<1, -1> = RTFRecord<RETURN_TO_FAB_LOTS_REQUESTOR_USER_ID$>
|
||||
SentFrom = 'OI_ADMIN'
|
||||
Subject = 'Return To Fab Form Updated'
|
||||
SendToGroup = ''
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error setting Eval. info. Return to fab record has already been completed.'
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user