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

@ -19,7 +19,7 @@ COMPILE FUNCTION obj_WO_Mat_Log(Method,Parms)
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, Dialog_Box, NextKey, Popup, Get_Property, obj_RDS, Database_Services
Declare function Logging_Services, Environment_Services, RTI_CreateGUID, Error_Services, Datetime
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn, Btree.Extract, ErrMsg, Send_Dyn, RList, obj_WO_Log, Send_Event, obj_RDS
DECLARE SUBROUTINE obj_WO_Mat, Send_Info, obj_Notes, Logging_Services, Database_Services, Lot_Services
DECLARE SUBROUTINE obj_WO_Mat, Send_Info, obj_Notes, Logging_Services, Database_Services, Lot_Event_Services
$INSERT MSG_EQUATES
$INSERT WO_MAT_LOG_EQUATES
@ -166,8 +166,7 @@ Create:
CassNo = CassNos
WOMatKey = WONo : '*' : CassNo
RDSKey = XLATE('WO_MAT', WOMatKey, WO_MAT_RDS_NO$, 'X')
Lot_Services('CreateLotEvent', RDSKey, 'RDS', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Services('CreateLotEvent', WOMatKey, 'WO_MAT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', RDSKey, Datetime(), Action, '', '', UserId, True$, 'RDS')
end else
Begin Case
Case Action EQ 'RCVD'
@ -176,14 +175,14 @@ Create:
StepNo = 1
CassNo = CassNos
WMInKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMInKey, 'WM_IN', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMInKey, Datetime(), Action, '', '', UserId, True$, 'WM_IN')
Case Action EQ 'REL'
//WMI
WONo = WoNos
StepNo = 1
CassNo = CassNos
WMInKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMInKey, 'WM_IN', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMInKey, Datetime(), Action, '', '', UserId, True$, 'WM_IN')
Case Action EQ '1VER'
//RDS action, do nothing for now
Case Action EQ '1LOAD'
@ -195,38 +194,38 @@ Create:
StepNo = 1
CassNo = CassNos
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, Datetime(), Action, '', '', UserId, True$, 'WM_OUT')
Case Action EQ '1MO_QA'
WONo = WoNos
StepNo = 1
CassNo = CassNos
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, Datetime(), Action, '', '', UserId, True$, 'WM_OUT')
Case Action EQ 'PACK'
WONo = WoNos
StepNo = 1
CassNo = CassNos
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, Datetime(), Action, '', '', UserId, True$, 'WM_OUT')
Case Action EQ 'PSVER'
WONo = WoNos
StepNo = 1
CassNo = CassNos
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, Datetime(), Action, '', '', UserId, True$, 'WM_OUT')
Case Action EQ 'SHIP'
WONo = WoNos
StepNo = 1
CassNo = CassNos
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, Datetime(), Action, '', '', UserId, True$, 'WM_OUT')
Case Action EQ 'LBLCHK'
//WMO
WONo = WoNos
StepNo = 1
CassNo = CassNos
WMOutKey = WONo : '*' : StepNo : '*' : CassNo
Lot_Services('CreateLotEvent', WMOutKey, 'WM_OUT', Datetime(), Action, '', '', 0, 0, '', UserID)
Lot_Event_Services('CreateLotEvent', WMOutKey, Datetime(), Action, '', '', UserId, True$, 'WM_OUT')
End Case
end
ErrorMsg = ''
@ -364,3 +363,4 @@ Post:
end
RETURN