Merged PR 15668: Refactored Lot Event

Refactored Lot Event methods.
1. Moved all lot event methods to a new LOT_EVENT_SERVICES service module.
2. Simplified CreateLotEvent routine
3. Updated all calling stored procedures.
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-04-28 21:02:24 +02:00
parent b2edf6f288
commit 4037b2fa45
13 changed files with 260 additions and 446 deletions

View File

@ -58,7 +58,7 @@ $INSERT NOTIFICATION_EQU
Declare function Database_Services, Error_Services, Obj_Wm_In, Obj_Wm_Out, Unassigned, Wm_In_Services, Wm_Out_Services
Declare function PSN_Services, SRP_Rotate_Array, Datetime, Hold_Services, Memberof, Error_Services, Rds_Services
Declare subroutine Database_Services, Error_Services, Obj_notes, Hold_Services, Obj_Wm_In, Obj_Wm_Out, Wm_In_Services
Declare subroutine Wm_Out_Services, Rds_Services, Lot_Services
Declare subroutine Wm_Out_Services, Rds_Services, Lot_Event_Services
GoToService else
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.')
@ -371,18 +371,18 @@ Service OnHold(WOMatKey, HoldEntity, HoldEntityID, HoldType, HoldData, OperatorI
StepNo = 1
CassNo = Field(WOMatKey, '*', 2)
WMInKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMInKey, 'WM_IN', CurrDTM, 'HOLD_ON', 'Placed on hold', '', '', '', '', UserId)
Lot_Event_Services('CreateLotEvent', WMInKey, CurrDTM, 'HOLD_ON', 'Lot placed on hold.', '', UserId, True$, 'WM_IN')
Case HoldEntity EQ 'WM_OUT'
WONo = Field(WOMatKey, '*', 1)
StepNo = 1
CassNo = Field(WOMatKey, '*', 2)
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', CurrDTM, 'HOLD_ON', 'Placed on hold', '', '', '', '', UserId)
Lot_Event_Services('CreateLotEvent', WMOutKey, CurrDTM, 'HOLD_ON', 'Lot placed on hold.', '', UserId, True$, 'WM_OUT')
Case HoldEntity EQ 'RDS'
RDSNo = Xlate('WO_MAT', WOMatKey, WO_MAT_RDS_NO$, 'X')
Lot_Services('CreateLotEvent', RDSNo, 'RDS', CurrDTM, 'HOLD_ON', 'Placed on hold', '', '', '', '', UserId)
Lot_Event_Services('CreateLotEvent', RDSNo, CurrDTM, 'HOLD_ON', 'Lot placed on hold.', '', UserId, True$, 'RDS')
Case HoldEntity EQ 'WO_MAT'
Lot_Services('CreateLotEvent', WOMatKey, 'RDS', CurrDTM, 'HOLD_ON', 'Placed on hold', '', '', '', '', UserId)
Lot_Event_Services('CreateLotEvent', WOMatKey, CurrDTM, 'HOLD_ON', 'Lot placed on hold.', '', UserId, True$, 'WO_MAT')
End Case
end
end else
@ -507,18 +507,18 @@ Service OffHold(WOMatKey, HoldEntity, HoldEntityID, HoldType, HoldData, Operator
StepNo = 1
CassNo = Field(WOMatKey, '*', 2)
WMInKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMInKey, 'WM_IN', CurrDTM, 'HOLD_OFF', 'Placed on hold', '', '', '', '', UserID)
Lot_Event_Services('CreateLotEvent', WMInKey, CurrDTM, 'HOLD_OFF', 'Lot taken off hold.', '', UserId, True$, 'WM_IN')
Case HoldEntity EQ 'WM_OUT'
WONo = Field(WOMatKey, '*', 1)
StepNo = 1
CassNo = Field(WOMatKey, '*', 2)
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', CurrDTM, 'HOLD_OFF', 'Placed on hold', '', '', '', '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, CurrDTM, 'HOLD_OFF', 'Lot taken off hold.', '', UserId, True$, 'WM_OUT')
Case HoldEntity EQ 'RDS'
RDSNo = Xlate('WO_MAT', WOMatKey, WO_MAT_RDS_NO$, 'X')
Lot_Services('CreateLotEvent', RDSNo, 'RDS', CurrDTM, 'HOLD_OFF', 'Placed on hold', '', '', '', '', UserID)
Lot_Event_Services('CreateLotEvent', RDSNo, CurrDTM, 'HOLD_OFF', 'Lot taken off hold.', '', UserId, True$, 'RDS')
Case HoldEntity EQ 'WO_MAT'
Lot_Services('CreateLotEvent', WOMatKey, 'RDS', CurrDTM, 'HOLD_OFF', 'Placed on hold', '', '', '', '', UserID)
Lot_Event_Services('CreateLotEvent', WOMatKey, CurrDTM, 'HOLD_OFF', 'Lot taken off hold.', '', UserId, True$, 'WO_MAT')
End Case
end
end else
@ -815,3 +815,4 @@ Service CreateComment(HoldEntity, HoldEntityID, Reason, Transition, HoldType, Op
end service