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:
parent
b2edf6f288
commit
4037b2fa45
@ -2,9 +2,9 @@ Compile function Lot_Services(@Service, @Params)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare function TEST_WAFER_PROD_SERVICES, SRP_Datetime, Datetime, Database_Services, Lot_Services, Error_Services, RTI_CREATEGUID
|
||||
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf
|
||||
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf, Lot_Event_Services
|
||||
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services
|
||||
Declare subroutine SRP_Run_Command, Service_Services, obj_notes
|
||||
Declare subroutine SRP_Run_Command, Service_Services, obj_notes, Lot_Event_Services
|
||||
$insert APP_INSERTS
|
||||
$Insert LOT_EQUATES
|
||||
$Insert TEST_WAFER_PROD_EQUATES
|
||||
@ -194,10 +194,11 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
||||
//Get Curr Operation(Should be first one in sequence)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
||||
If ThisLotCurrOpId NE '' then
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'MOVE_IN', 'Move Lot in.', '', 0, 0, ThisLotCurrOpId, Username)
|
||||
if Error_Services('NoError') then
|
||||
//Set lot to open
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'OPEN', 'Setting lot to open.', '', 0, 0, '', Username)
|
||||
//Set lot to open
|
||||
Lot_Services('OpenLot', CreatedLotNumber)
|
||||
if Error_Services('NoError') then
|
||||
//Move lot in
|
||||
Lot_Services('MoveInLot', CreatedLotNumber, Username)
|
||||
if Error_Services('NoError') then
|
||||
If PrinterID NE 'WEB' then
|
||||
//If PrinterID is set to WEB this means the request comes from OI_Wizard and the client is going to handle printing.
|
||||
@ -206,11 +207,9 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'MOVE_OUT', 'Move Lot out.', '', 0, 0, '', Username)
|
||||
//Lot_Services('MoveOutLot', NewLotId, Username)
|
||||
Lot_Services('MoveOutLot', NewLotId, Username)
|
||||
If Error_Services('NoError') then
|
||||
//Lot_Services('MoveInLot', NewLotId, Username)
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'MOVE_IN', 'Move in out.', '', 0, 0, '', Username)
|
||||
Lot_Services('MoveInLot', NewLotId, Username)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
@ -222,18 +221,18 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
||||
end
|
||||
end else
|
||||
//Close LOT record as there was an error
|
||||
Lot_Services('CreateLotEvent', NewLotId, 'TW', Datetime(), 'CLOSE', 'Error occured while created lot. Automatically setting to close', '', 0, 0, '', 'SYSTEM')
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
Lot_Services('CloseLot', NewLotId)
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
//Close LOT record as there was an error
|
||||
Lot_Services('CreateLotEvent', NewLotId, 'TW', Datetime(), 'CLOSE', 'Error occured while created lot. Automatically setting to close', '', 0, 0, '', 'SYSTEM')
|
||||
Lot_Services('CloseLot', NewLotId)
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
//Close LOT record as there was an error
|
||||
//Database_Services('DeleteDataRow', 'LOT', NewLotId, True$, False$)
|
||||
Lot_Services('CreateLotEvent', NewLotId, 'TW', Datetime(), 'CLOSE', 'Error occured while created lot. Automatically setting to close', '', 0, 0, '', 'SYSTEM')
|
||||
Lot_Services('CloseLot', NewLotId)
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
@ -499,25 +498,6 @@ Service GetLotOperationSequence(LotId)
|
||||
Response = LotOperationsInSequence
|
||||
end service
|
||||
|
||||
//Returns a @FM delimited list of events in sequence
|
||||
Service GetLotEventsInSequence(LotId)
|
||||
|
||||
LotEventsUnsorted = ''
|
||||
LotEventsSorted = ''
|
||||
LotEventsToReturn = ''
|
||||
If LotID NE '' then
|
||||
//Get Operations
|
||||
LotEvents = Xlate('LOT', LotId, LOT_LOT_EVENTS$, 'X')
|
||||
for each LotEvent in LotEvents using @VM
|
||||
ThisEventSequence = XLATE('LOT_EVENT', LotEvent, LOT_EVENT_SEQUENCE$, 'X')
|
||||
LotEventsToReturn<ThisEventSequence> = LotEvent
|
||||
Next LotOperation
|
||||
end else
|
||||
//error: lot id was null
|
||||
end
|
||||
Response = LotEventsToReturn
|
||||
end service
|
||||
|
||||
Service GetLotCurrOperationId(LotId)
|
||||
CurrOperation = ''
|
||||
If LotID NE '' then
|
||||
@ -639,6 +619,7 @@ Service IsOperationCompleted(LotOperationId)
|
||||
end service
|
||||
|
||||
Service MoveInLot(LotID, Operator)
|
||||
|
||||
ErrorMessage = ''
|
||||
ThisLotCurrOperationID = ''
|
||||
If LotId NE '' then
|
||||
@ -657,7 +638,9 @@ Service MoveInLot(LotID, Operator)
|
||||
If Error_Services('NoError') then
|
||||
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
|
||||
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
If Error_Services('HasError') then
|
||||
If Error_Services('NoError') then
|
||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_IN', 'Lot moved into operation ' : CurrOperation : '.', '', Operator)
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
@ -705,8 +688,10 @@ Service MoveOutLot(LotID, Operator)
|
||||
If Error_Services('NoError') then
|
||||
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
|
||||
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
If Error_Services('NoError') then
|
||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'MOVE_OUT', 'Lot moved out of operation ' : CurrOperation : '.', '', Operator)
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage')
|
||||
@ -746,262 +731,6 @@ Service MoveOutLot(LotID, Operator)
|
||||
end
|
||||
end service
|
||||
|
||||
Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_TYPES, EventNote, EventEquipmentId, ReduceWaferQty, BonusWaferQty, OperationId, OperatorId)
|
||||
ErrorMessage = ''
|
||||
BeginWaferQty = 0
|
||||
EndWaferQty = 0
|
||||
WaferQtyChange = 0
|
||||
If LotId NE '' then
|
||||
Begin Case
|
||||
Case LotType EQ 'TW'
|
||||
If OperatorId NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ValidId = False$
|
||||
NewEventId = ''
|
||||
Loop
|
||||
NewEventId = RTI_CreateGUID()
|
||||
If Not(RowExists('LOT_EVENT', NewEventId)) then
|
||||
ValidId = True$
|
||||
end
|
||||
Until ValidId EQ True$
|
||||
Repeat
|
||||
BeginWaferQty = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
|
||||
If OperationID EQ '' then
|
||||
OperationID = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
end
|
||||
If OperationID NE '' then
|
||||
Begin Case
|
||||
Case EventType EQ 'MOVE_IN'
|
||||
Lot_Services('MoveInLot', LotId, OperatorId)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'MOVE_OUT'
|
||||
Lot_Services('MoveOutLot', LotId, OperatorId)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'HOLD_ON'
|
||||
Lot_Services('HoldLot', LotId, OperatorId)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'HOLD_OFF'
|
||||
Lot_Services('UnholdLot', LotId, OperatorId)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'REDUCE_WAFER_QTY'
|
||||
Lot_Services('ReduceLotWaferCount', LotId, ReduceWaferQty, OperatorId)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'BONUS_WAFER_QTY'
|
||||
Lot_Services('IncreaseLotWaferCount', LotId, BonusWaferQty)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'COMMENT'
|
||||
//Do Nothing Extra
|
||||
Case EventType EQ 'LOCATION'
|
||||
//Do nothing for now.
|
||||
Case EventType EQ 'CLOSE'
|
||||
Lot_Services('CloseLot', LotId, OperatorId)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create Lot Event routine, ' : Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'OPEN'
|
||||
Lot_Services('OpenLot', LotId)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create Lot Event routine, ' : Error_Services('GetMessage')
|
||||
end
|
||||
Case Otherwise$
|
||||
ErrorMessage = 'Error in Create Lot Event routine, event type of ' : EventType : ' passed to routine is not valid for a lot of type TW.'
|
||||
End Case
|
||||
|
||||
If ErrorMessage EQ '' then
|
||||
EndWaferQty = (BeginWaferQty + BonusWaferQty) - ReduceWaferQty
|
||||
|
||||
NewEventRec = ''
|
||||
NewEventRec<LOT_EVENT_LOT_ID$> = LotId
|
||||
NewEventRec<LOT_EVENT_LOT_EVENT_TYPE$> = EventType
|
||||
NewEventRec<LOT_EVENT_EVENT_DATETIME$> = EventDatetime
|
||||
NewEventRec<LOT_EVENT_EVENT_NOTE$> = EventNote
|
||||
NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId
|
||||
NewEventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$> = ReduceWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$> = BonusWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$> = BeginWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_END_WAFER_QTY$> = EndWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATION_ID$> = OperationId
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId
|
||||
NewEventSequence = Lot_Services('GetLotEventNextSequence', LotId)
|
||||
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
|
||||
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
|
||||
if Error_Services('NoError') then
|
||||
If BeginWaferQty NE EndWaferQty then
|
||||
//Adjust LOT wafer qty
|
||||
LotRecord = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
If LotRecord NE '' then
|
||||
LotRecord<LOT_WAFER_QTY$> = EndWaferQty
|
||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRecord, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in CreateLotEvent routine, failed attempt to close lot ':LotId:'. Failed to write to LOT record.'
|
||||
end
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Error writing Lot Event record, ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Current Operation for lot id ' : LotId : ' could not be determined.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot Id passed to routine was not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Operator ID was null.'
|
||||
end
|
||||
Case LotType EQ 'RDS' OR LotType EQ 'WO_MAT' OR LotType EQ 'WM_IN' OR LotType EQ 'WM_OUT'
|
||||
ExistingLotId = Lot_Services('GetLotIdByLegacyLotIdAndType', LotId, LotType)
|
||||
LegacyLotId = LotId
|
||||
If ExistingLotId NE '' then
|
||||
LotId = ExistingLotId
|
||||
end else
|
||||
LotId = Lot_Services('CreateNewLot', LotType, '', '', '', '', '', OperatorId, '', LegacyLotId)
|
||||
end
|
||||
If RowExists('LOT', LotId) then
|
||||
If EventType NE '' AND OperatorId NE '' then
|
||||
ValidId = False$
|
||||
NewEventId = ''
|
||||
Loop
|
||||
NewEventId = RTI_CreateGUID()
|
||||
If Not(RowExists('LOT_EVENT', NewEventId)) then
|
||||
ValidId = True$
|
||||
end
|
||||
Until ValidId EQ True$
|
||||
Repeat
|
||||
BeginWaferQty = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
|
||||
If ReduceWaferQty NE '' then
|
||||
If Num(ReduceWaferQty) then
|
||||
EndWaferQty = BeginWaferQty - ReduceWaferQty
|
||||
end
|
||||
end
|
||||
If BonusWaferQty NE '' then
|
||||
If Num(BonusWaferQty) then
|
||||
EndWaferQty = BeginWaferQty + BonusWaferQty
|
||||
end
|
||||
end
|
||||
If Not(Num(EventDatetime)) then EventDatetime = IConv(EventDatetime, 'DT')
|
||||
|
||||
Begin Case
|
||||
Case EventType EQ 'VOID'
|
||||
Lot_Services('CreateNewVoidedLotRecord', LotId, LegacyLotId, LotType, OperatorId)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case Otherwise$
|
||||
//Do Nothing extra
|
||||
End Case
|
||||
If ErrorMessage EQ '' then
|
||||
NewEventRec = ''
|
||||
NewEventRec<LOT_EVENT_LOT_ID$> = LotId
|
||||
NewEventRec<LOT_EVENT_LOT_EVENT_TYPE$> = EventType
|
||||
NewEventRec<LOT_EVENT_EVENT_DATETIME$> = EventDatetime
|
||||
NewEventRec<LOT_EVENT_EVENT_NOTE$> = EventNote
|
||||
NewEventRec<LOT_EVENT_EQUIPMENT_ID$> = EventEquipmentId
|
||||
NewEventRec<LOT_EVENT_EVENT_REDUCE_WAFER_QTY$> = ReduceWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BONUS_WAFER_QTY$> = BonusWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_BEGIN_WAFER_QTY$> = BeginWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_END_WAFER_QTY$> = EndWaferQty
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATION_ID$> = OperationId
|
||||
NewEventRec<LOT_EVENT_EVENT_OPERATOR_ID$> = OperatorId
|
||||
NewEventSequence = Lot_Services('GetLotEventNextSequence', LotId)
|
||||
NewEventRec<LOT_EVENT_SEQUENCE$> = NewEventSequence
|
||||
Database_Services('WriteDataRow', 'LOT_EVENT', NewEventId, NewEventRec)
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Operator ID was null.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot Id passed to routine was not found in LOT table.'
|
||||
end
|
||||
Case Otherwise$
|
||||
ErrorMessage = 'Error in Create Lot Event routine, An invalid lot type was passed to routine.'
|
||||
End Case
|
||||
If Assigned(NewEventId) AND Assigned(LotId) then
|
||||
If RowExists('LOT_EVENT', NewEventId) AND RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
LotRec<LOT_MOST_RECENT_LOT_EVENT_ID$> = NewEventId
|
||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec)
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, A null value for Lot Id was passed to routine.'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotId
|
||||
LogData<3> = EventType
|
||||
LogData<4> = OperatorId
|
||||
LogData<5> = BeginWaferQty
|
||||
LogData<6> = EndWaferQty
|
||||
LogData<7> = BonusWaferQty
|
||||
LogData<8> = ReduceWaferQty
|
||||
LogData<9> = 'Successfully logged event.'
|
||||
Logging_Services('AppendLog', objLotEventLog, LogData, @RM, @FM, False$)
|
||||
end else
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotId
|
||||
LogData<3> = EventType
|
||||
LogData<4> = OperatorId
|
||||
LogData<5> = BeginWaferQty
|
||||
LogData<6> = EndWaferQty
|
||||
LogData<7> = BonusWaferQty
|
||||
LogData<8> = ReduceWaferQty
|
||||
LogData<9> = ErrorMessage
|
||||
Logging_Services('AppendLog', objLotEventLog, LogData, @RM, @FM, False$)
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service GetLotEventNextSequence(LotId)
|
||||
ErrorMessage = ''
|
||||
NextSequence = 1
|
||||
If LotID NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
LotEvents = XLATE('LOT', LotId, LOT_LOT_EVENTS$, 'X')
|
||||
for each LotEvent in LotEvents using @VM
|
||||
ThisEventSequence = XLATE('LOT_EVENT', LotEvent, LOT_EVENT_SEQUENCE$, 'X')
|
||||
If ThisEventSequence GE NextSequence then NextSequence = ThisEventSequence + 1
|
||||
Next LotEvent
|
||||
end else
|
||||
ErrorMessage = 'Unable to get lot event sequence: Lot ID not found.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Unable to get lot event sequence: Lot ID was null.'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
Response = NextSequence
|
||||
end else
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||
|
||||
ErrorMessage = ''
|
||||
@ -1042,7 +771,7 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||
//Events Array
|
||||
EventsArrayJson = ''
|
||||
If SRP_Json(EventsArrayJson, 'New', 'Array') then
|
||||
LotEventKeys = Lot_Services('GetLotEventsInSequence', LotId)
|
||||
LotEventKeys = Lot_Event_Services('GetLotEventsInSequence', LotId)
|
||||
for each LotEventKey in LotEventKeys using @FM
|
||||
objEvent = ''
|
||||
EventRec = Database_Services('ReadDataRow', 'LOT_EVENT', LotEventKey)
|
||||
@ -1131,8 +860,10 @@ Service OpenLot(LotId)
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
LotRec<LOT_OPEN$> = True$
|
||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error setting lot ' : LotId : ' to open.' : Error_Services('GetMessage')
|
||||
If Error_Services('NoError') then
|
||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'OPEN', 'Lot status set to Open.', '', 'SYSTEM')
|
||||
end else
|
||||
ErrorMessage = 'Error setting lot ' : LotId : ' to open.' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Unable to Open Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
||||
@ -1148,8 +879,10 @@ Service CloseLot(LotId)
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
LotRec<LOT_OPEN$> = False$
|
||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error setting lot ' : LotId : ' to closed.' : Error_Services('GetMessage')
|
||||
If Error_Services('NoError') then
|
||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'CLOSE', 'Lot status set to Closed', '', 'SYSTEM')
|
||||
end else
|
||||
ErrorMessage = 'Error setting lot ' : LotId : ' to closed.' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Unable to Close Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
||||
@ -1212,7 +945,8 @@ Service AutoCloseTestWaferLot(LotId, CloseUserId)
|
||||
ErrorMessage = CloseUserId : ' does not have permission to close this lot.'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
Lot_Services('CreateLotEvent', LotId, 'TW', AutoCloseTime, 'CLOSE', 'Close action performed by ' : CloseUserId, '', '', '', ThisLotOperationId, CloseUserId)
|
||||
//Close Lot as there were no validation failures.
|
||||
Lot_Services('CloseLot', LotId)
|
||||
If Error_Services('NoError') then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
@ -1276,7 +1010,9 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
||||
LotRec<LOT_WAFER_QTY$> = LotNewWfrQty
|
||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
||||
If Error_Services('NoError') then
|
||||
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
|
||||
//Write Lot Event
|
||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'REDUCE_WAFER_QTY', 'Reduced wafer count by ' : ReductionQty, '', OperatorId, False$, '')
|
||||
if LotNewWfrQty EQ 0 AND LotType EQ 'TW' then
|
||||
ServiceParms = 'AutoCloseTestWaferLot' : @VM : LotId : @VM : 'SYSTEM'
|
||||
Service_Services('PostProcedure', 'LOT_SERVICES', ServiceParms)
|
||||
If Error_Services('HasError') then
|
||||
@ -1291,7 +1027,7 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
||||
end
|
||||
end else
|
||||
Begin Case
|
||||
@ -1309,7 +1045,7 @@ Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
||||
end
|
||||
end service
|
||||
|
||||
Service IncreaseLotWaferCount(LotId, IncreaseQty)
|
||||
Service IncreaseLotWaferCount(LotId, IncreaseQty, OperatorId)
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
@ -1323,8 +1059,11 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty)
|
||||
If LotNewWfrQty LE 25 AND LotNewWfrQty GT 0 then
|
||||
LotRec<LOT_WAFER_QTY$> = LotNewWfrQty
|
||||
Database_Services('WriteDataRow', 'LOT', LotId, LotRec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
||||
If Error_Services('NoError') then
|
||||
//Write Lot Event
|
||||
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'INCREASE_WAFER_QTY', 'Increased wafer count by ' : IncreaseQty, '', OperatorId, False$, '')
|
||||
end else
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
||||
end
|
||||
end else
|
||||
Begin Case
|
||||
@ -1347,6 +1086,7 @@ Service IncreaseLotWaferCount(LotId, IncreaseQty)
|
||||
if ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
Service OpenOIWizardCreateTWLotInBrowser()
|
||||
@ -1436,3 +1176,4 @@ end service
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user