ebase 8/22/2025
Modified RDS_Actions to fix RDSNo being unassigned when calling obj_wo_react -> RemRDS various bug fixes Re-initializaing branch Modified RDS_Actions to fix RDSNo being unassigned when calling obj_wo_react -> RemRDS Added a check prior to running Load logic to check that a reactor is assigned.
This commit is contained in:
@ -118,7 +118,7 @@ AutoDisplayErrors = FALSE$ ; // Set this to True$ when debugging so all erro
|
||||
|
||||
Declare subroutine SRP_Stopwatch, Error_Services, obj_Tables, Metrology_Services, obj_RDS_Test, SRP_JSON, Logging_Services
|
||||
Declare subroutine RTI_Set_Debugger, Database_Services, Btree.Extract, Extract_SI_Keys, Obj_WO_Mat, Obj_WO_Mat_Log
|
||||
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status , Reactor_Services
|
||||
Declare subroutine Dialog_Box, Obj_Notes, RList, Set_Status, Errmsg, Obj_React_Status, Reactor_Services
|
||||
Declare subroutine Rds_Services, Obj_Post_Log, Mona_Services, Transaction_Services, Reduce
|
||||
Declare function SRP_Sort_Array, Metrology_Services, obj_RDS_Test, obj_Test_Point_Map, Database_Services
|
||||
Declare function Work_Order_Services, SRP_JSON, Logging_Services, Environment_Services, SRP_Trim, Error_Services
|
||||
@ -1461,12 +1461,11 @@ Service SignUnloadExtra1(RDSNo, LSLUserName)
|
||||
RDSRec<RDS_OP_OUT_EX1$> = LSLUsername
|
||||
RDSRec<RDS_OP_OUT_EX1_DATE$> = SRP_Date('Today')
|
||||
RDSRec<RDS_OP_OUT_EX1_TIME$> = SRP_Time('Now')
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
Reactor = RDSRec<RDS_REACTOR$>
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Unload Extra 1 Signed from Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end else
|
||||
Error_Services('Add', 'Unload Extra 1 is not able to be signed at this stage')
|
||||
end
|
||||
@ -1494,12 +1493,11 @@ Service UnsignUnloadExtra1(RDSNo, LSLUserName)
|
||||
RDSRec<RDS_OP_OUT_EX1$> = ''
|
||||
RDSRec<RDS_OP_OUT_EX1_DATE$> = ''
|
||||
RDSRec<RDS_OP_OUT_EX1_TIME$> = ''
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
Reactor = RDSRec<RDS_REACTOR$>
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Unload Extra 1 Unsigned on Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end else
|
||||
Error_Services('Add', 'Unsign Load Extra 1 is not able to be unsigned.')
|
||||
end
|
||||
@ -1534,11 +1532,10 @@ Service SignLoadExtra1(RDSNo,LSLUserName)
|
||||
RDSRec<RDS_OP_IN_EX2$> = LSLUsername
|
||||
RDSRec<RDS_OP_IN_EX2_DATE$> = SRP_Date('Today')
|
||||
RDSRec<RDS_OP_IN_EX2_TIME$> = SRP_Time('Now')
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Load Extra 1 Signed to Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end else
|
||||
Error_Services('Add', 'Load Extra 1 is not able to be signed at this stage')
|
||||
end
|
||||
@ -1569,12 +1566,11 @@ Service UnsignLoadExtra1(RDSNo, LSLUserName)
|
||||
RDSRec<RDS_OP_IN_EX2$> = ''
|
||||
RDSRec<RDS_OP_IN_EX2_DATE$> = ''
|
||||
RDSRec<RDS_OP_IN_EX2_TIME$> = ''
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
Reactor = RDSRec<RDS_REACTOR$>
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Load Extra 1 Unsigned on Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end else
|
||||
Error_Services('Add', 'Unsign Load Extra 1 is not able to be unsigned.')
|
||||
end
|
||||
@ -1598,12 +1594,11 @@ Service SignUnloadExtra2(RDSNo,LSLUserName)
|
||||
RDSRec<RDS_OP_OUT_EX2$> = LSLUsername
|
||||
RDSRec<RDS_OP_OUT_EX2_DATE$> = SRP_Date('Today')
|
||||
RDSRec<RDS_OP_OUT_EX2_TIME$> = SRP_Time('Now')
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
Reactor = RDSRec<RDS_REACTOR$>
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Unload Extra 2 Signed from Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end else
|
||||
Error_Services('Add', 'Unload Extra 2 is not able to be signed at this stage')
|
||||
end
|
||||
@ -1631,12 +1626,11 @@ Service UnsignUnloadExtra2(RDSNo, LSLUserName)
|
||||
RDSRec<RDS_OP_OUT_EX2$> = ''
|
||||
RDSRec<RDS_OP_OUT_EX2_DATE$> = ''
|
||||
RDSRec<RDS_OP_OUT_EX2_TIME$> = ''
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
Reactor = RDSRec<RDS_REACTOR$>
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Unload Extra 2 Unsigned on Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end else
|
||||
Error_Services('Add', 'Unsign Load Extra 2 is not able to be unsigned.')
|
||||
end
|
||||
@ -1671,11 +1665,10 @@ Service SignLoadExtra2(RDSNo,LSLUserName)
|
||||
RDSRec<RDS_OP_IN_EX3$> = LSLUsername
|
||||
RDSRec<RDS_OP_IN_EX3_DATE$> = SRP_Date('Today')
|
||||
RDSRec<RDS_OP_IN_EX3_TIME$> = SRP_Time('Now')
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Load Extra 2 Signed to Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end
|
||||
Reactor_Services('AddRDSToReactorLoad', RDSNo, Reactor)
|
||||
end else
|
||||
Error_Services('Add', 'Load Extra 2 is not able to be signed at this stage')
|
||||
end
|
||||
@ -1689,7 +1682,7 @@ Service SignLoadExtra2(RDSNo,LSLUserName)
|
||||
Error_Services('Add', 'RDS ' : RDSNo : ' does not exist.')
|
||||
end
|
||||
end else
|
||||
Error_Services('Add', 'Invalid user passed to Sign Unload Extra 1 routine')
|
||||
Error_Services('Add', 'Invalid user passed to Sign Unload Extra 2 routine')
|
||||
end
|
||||
|
||||
end service
|
||||
@ -1705,12 +1698,11 @@ Service UnsignLoadExtra2(RDSNo, LSLUserName)
|
||||
RDSRec<RDS_OP_IN_EX3$> = ''
|
||||
RDSRec<RDS_OP_IN_EX3_DATE$> = ''
|
||||
RDSRec<RDS_OP_IN_EX3_TIME$> = ''
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, True$)
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
Reactor = RDSRec<RDS_REACTOR$>
|
||||
If Error_Services('NoError') then
|
||||
Rds_Services('AddComment', RDSNo, 'Load Extra 2 Unsigned on Reactor ' : Reactor, LSLUserName)
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end
|
||||
Reactor_Services('RemoveRDSFromReactorLoad', RDSNo, Reactor, LSLUserName)
|
||||
end else
|
||||
Error_Services('Add', 'Unsign Load Extra 2 is not able to be unsigned.')
|
||||
end
|
||||
@ -1868,6 +1860,47 @@ Service DetachRDSFromWO(RDSNo)
|
||||
|
||||
end service
|
||||
|
||||
Service ChangeReactor(RDSNo, NewReactorNo)
|
||||
|
||||
ErrorMessage = ''
|
||||
If RDSNo NE '' AND NewReactorNo NE '' then
|
||||
RDSRec = Database_Services('ReadDataRow', 'RDS', RDSNo)
|
||||
WONo = RDSRec<RDS_WO$>
|
||||
Query = 'SELECT REACT_STATE WITH SCHED_WO CONTAINING ':WONo
|
||||
ClearSelect
|
||||
Set_Status(0)
|
||||
RList(Query, TARGET_ACTIVELIST$, '', '' '')
|
||||
SchedReactors = ''
|
||||
EOF = False$
|
||||
Loop
|
||||
ReadNext SchedReactor else EOF = True$
|
||||
Until EOF
|
||||
SchedReactors<0, -1> = SchedReactor
|
||||
Repeat
|
||||
|
||||
Locate NewReactorNo in SchedReactors using @VM setting vPos then
|
||||
RDSRec<RDS_REACTOR$> = NewReactorNo
|
||||
Database_Services('WriteDataRow', 'RDS', RDSNo, RDSRec, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Response = True$
|
||||
end else
|
||||
Response = False$
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
Swap @VM with ',' in SchedReactors
|
||||
ErrorMessage = 'Assigned reactor, ':NewReactorNo:', does not equal any scheduled reactor(s), ':SchedReactors:'.'
|
||||
Response = False$
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Missing RDSNo or NewReactorNo param.'
|
||||
end
|
||||
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Set', ErrorMessage)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
Service PushSigProfileToWoMat(RDSNo)
|
||||
|
||||
@ -1889,12 +1922,9 @@ Service PushSigProfileToWoMat(RDSNo)
|
||||
If WOMatKey NE '' then
|
||||
WOMatRec = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
||||
If Error_Services('NoError') then
|
||||
WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey)
|
||||
WOMatSig = WOMatRec<WO_MAT_SIGNATURE$>
|
||||
WOMatSigDTM = WOMatRec<WO_MAT_SIG_DTM$>
|
||||
WOMatSigProfOrig = WOMatSigProf
|
||||
WOMatSigOrig = WOMatSig
|
||||
WOMatSigDTMOrig = WOMatSigDTM
|
||||
WOMatSigProf = obj_WO_Mat('CassSigProfile', WOMatKey)
|
||||
WOMatSig = WOMatRec<WO_MAT_SIGNATURE$>
|
||||
WOMatSigDTM = WOMatRec<WO_MAT_SIG_DTM$>
|
||||
|
||||
// Update WO_MAT signature profile to match for the "1VER" stage
|
||||
Stage = '1VER'
|
||||
@ -1966,15 +1996,9 @@ Service PushSigProfileToWoMat(RDSNo)
|
||||
WOMatSigDTM<0, vPos> = FQASigDTM
|
||||
end
|
||||
|
||||
If WOMatSigProf NE WOMatSigProfOrig then
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf)
|
||||
end
|
||||
If WOMatSig NE WOMatSigOrig then
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSig)
|
||||
end
|
||||
If WOMatSigDTM NE WOMatSigDTMOrig then
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTM)
|
||||
end
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_PROFILE$, WOMatSigProf)
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIGNATURE$, WOMatSig)
|
||||
Transaction_Services('PostWriteFieldTransaction', 'WO_MAT', WOMatKey, WO_MAT_SIG_DTM$, WOMatSigDTM)
|
||||
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
@ -1997,9 +2021,7 @@ Service PushSigProfileToWoMat(RDSNo)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service AllTWUseSigned(RDSNo)
|
||||
|
||||
If RDSNo NE '' then
|
||||
LSKeys = Xlate('RDS', RDSNo, 'RDS_LS_SORTED', 'X')
|
||||
AllMetKeys = XLATE('RDS_LAYER', LSKeys, RDS_LAYER_RDS_TEST_KEYS$, 'X')
|
||||
@ -2022,10 +2044,8 @@ Service AllTWUseSigned(RDSNo)
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service GetRDSKeys(WONo)
|
||||
|
||||
Response = ''
|
||||
@ -2286,6 +2306,136 @@ Service VerifyWOLogRDSKeyIndex(RDSNo)
|
||||
|
||||
end service
|
||||
|
||||
Service CheckUserRDSModificationPerm(UserId)
|
||||
|
||||
ErrorMsg = ''
|
||||
CanUserModify = False$
|
||||
|
||||
If UserId NE '' then
|
||||
If RowExists('LSL_USERS', UserId) then
|
||||
Begin Case
|
||||
Case MemberOf(UserId, 'ENGINEERING')
|
||||
CanUserModify = True$
|
||||
Case MemberOf(UserId, 'OI_ADMIN')
|
||||
CanUserModify = True$
|
||||
Case MemberOf(UserId, 'SUPERVISOR')
|
||||
CanUserModify = True$
|
||||
Case MemberOf(UserId, 'LEAD')
|
||||
CanUserModify = True$
|
||||
Case MemberOf(UserId, 'ENG_TECH')
|
||||
CanUserModify = True$
|
||||
Case Otherwise$
|
||||
CanUserModify = False$
|
||||
End Case
|
||||
end else
|
||||
ErrorMsg = 'User not found in Users table.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'User Id was null.'
|
||||
end
|
||||
|
||||
If ErrorMsg NE '' then
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
|
||||
Response = CanUserModify
|
||||
|
||||
end service
|
||||
|
||||
Service UnsignPreEpiSignature(RDSNo, UserId)
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\RDS\Signatures'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Pre-Epi-Unsign.csv'
|
||||
Headers = 'Logging DTM':@FM:'RDS No.':@FM:'User':@FM:'Message'
|
||||
objPreEpiUnsignLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, COMMA$, Headers, '', False$, False$)
|
||||
LoggingDTM = LogDate : ' ' : LogTime
|
||||
|
||||
ErrorMsg = ''
|
||||
PreEpiUnsign = False$
|
||||
If RDSNo NE '' then
|
||||
If RowExists('RDS', RDSNo) then
|
||||
if UserId NE '' then
|
||||
if RowExists('LSL_USERS', UserId) then
|
||||
CanUserModifyRDS = RDS_Services('CheckUserRDSModificationPerm', UserId)
|
||||
If Error_Services('NoError') then
|
||||
If CanUserModifyRDS then
|
||||
UnsignPreEpiReady = QA_Services('UnsignPreEpiReady', RDSNo)
|
||||
if Error_Services('NoError') then
|
||||
If UnsignPreEpiReady then
|
||||
Database_Services('WriteDataColumn', 'RDS', RDSNo, RDS_PRE_EPI_SIG$, '', True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Database_Services('WriteDataColumn', 'RDS', RDSNo, RDS_PRE_EPI_SIG_DATE$, '', True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Database_Services('WriteDataColumn', 'RDS', RDSNo, RDS_PRE_EPI_SIG_TIME$, '', True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
Database_Services('WriteDataColumn', 'RDS', RDSNo, RDS_VERIFY_QTY$, '', True$, False$, False$)
|
||||
if Error_Services('NoError') then
|
||||
Database_Services('WriteDataColumn', 'RDS', RDSNo, RDS_REACTOR$, '', True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
PreEpiUnsign = True$
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error clearing the RDS Pre Epi Signature Time on RDS ' : RDSNo : '.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error clearing the RDS Pre Epi Signature Date on RDS ' : RDSNo : '.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Error clearing the RDS Pre Epi Signature on RDS ' : RDSNo : '.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'Pre Epi is unable to be unsigned because a signature beyond pre-epi exists.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'User does not have permissions to perform a Pre-Epi Unsign'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'User ' : UserId : ' not found in database.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'User Id was null.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'RDS ' : RDSNo : ' not found in database.'
|
||||
end
|
||||
end else
|
||||
ErrorMsg = 'RDS Number was null.'
|
||||
end
|
||||
|
||||
If ErrorMsg EQ '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = RDSNo
|
||||
LogData<3> = UserId
|
||||
LogData<4> = 'Successfully unsigned pre-epi signature.'
|
||||
Logging_Services('AppendLog', objPreEpiUnsignLog, LogData, @RM, @FM, False$)
|
||||
end else
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = RDSNo
|
||||
LogData<3> = UserId
|
||||
LogData<4> = ErrorMsg
|
||||
Logging_Services('AppendLog', objPreEpiUnsignLog, LogData, @RM, @FM, False$)
|
||||
Error_Services('Add', ErrorMsg)
|
||||
end
|
||||
|
||||
Response = PreEpiUnsign
|
||||
|
||||
end service
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal GoSubs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -2298,3 +2448,19 @@ ClearCursors:
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user