Re-adding from old branch
This commit is contained in:
committed by
Ouellette Jonathan (CSC FI SPS MESLEO)
parent
ef1744c8b1
commit
3a2ff00722
@ -28,7 +28,7 @@ LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' L
|
||||
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Event Type' : @FM : 'Operator' : @FM : 'Begin Wafer Qty' : @FM : 'End Wafer Qty' : @FM : 'Bonus Wafer Qty' : @FM : 'Reduce Wafer Qty' : @FM : 'Message'
|
||||
objLotEventLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD'
|
||||
Options EVENT_TYPES = 'MOVE_IN', 'MOVE_OUT', 'HOLD_ON', 'HOLD_OFF', 'REDUCE_WAFER_QTY', 'BONUS_WAFER_QTY', 'COMMENT', 'LOCATION', 'LOAD', 'UNSIGN_LOAD', 'TW_USE'
|
||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN'
|
||||
|
||||
GoToService
|
||||
@ -81,6 +81,7 @@ end service
|
||||
|
||||
Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, VendorCode, Username, PrinterID, LotId)
|
||||
; //649491 , 03M6241, 814474, SP
|
||||
debug
|
||||
CreatedLotNumber = ''
|
||||
ErrorMessage = ''
|
||||
Begin Case
|
||||
@ -135,9 +136,10 @@ Service CreateNewLot(LotType, ProdName, LotQty, VendorPartNo, VendorLotNo, Vendo
|
||||
If Error_Services('NoError') then
|
||||
//Check in at first operation
|
||||
//Get Curr Operation(Should be first one in sequence)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperation', CreatedLotNumber)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
||||
If ThisLotCurrOpId NE '' then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'MOVE_IN', 'Move Lot in.', '', 0, 0, ThisLotCurrOpId, Username)
|
||||
//Lot_Services('MoveInLot', NewLotId, Username)
|
||||
if Error_Services('NoError') then
|
||||
//Set lot to open
|
||||
Lot_Services('OpenLot', CreatedLotNumber)
|
||||
@ -149,9 +151,11 @@ 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('MoveOutLot', NewLotId, LotQty, Username)
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'MOVE_OUT', 'Move Lot out.', '', 0, 0, '', Username)
|
||||
//Lot_Services('MoveOutLot', NewLotId, Username)
|
||||
If Error_Services('NoError') then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
//Lot_Services('MoveInLot', NewLotId, Username)
|
||||
Lot_Services('CreateLotEvent', CreatedLotNumber, 'TW', Datetime(), 'MOVE_IN', 'Move in out.', '', 0, 0, '', Username)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
@ -249,9 +253,9 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
||||
If Error_Services('NoError') then
|
||||
//Check in at first operation
|
||||
//Get Curr Operation(Should be first one in sequence)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperation', CreatedLotNumber)
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperationId', CreatedLotNumber)
|
||||
If ThisLotCurrOpId NE '' then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
Lot_Services('MoveInLot', NewLotId, Username)
|
||||
if Error_Services('NoError') then
|
||||
//Set lot to open
|
||||
Lot_Services('OpenLot', CreatedLotNumber)
|
||||
@ -263,9 +267,9 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
Lot_Services('MoveOutLot', NewLotId, LotQty, Username)
|
||||
Lot_Services('MoveOutLot', NewLotId, Username)
|
||||
If Error_Services('NoError') then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, 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
|
||||
@ -454,7 +458,7 @@ Service GetLotEventsInSequence(LotId)
|
||||
Response = LotEventsToReturn
|
||||
end service
|
||||
|
||||
Service GetLotCurrOperation(LotId)
|
||||
Service GetLotCurrOperationId(LotId)
|
||||
CurrOperation = ''
|
||||
If LotID NE '' then
|
||||
//Get them in sequence first
|
||||
@ -473,13 +477,34 @@ Service GetLotCurrOperation(LotId)
|
||||
Response = CurrOperation
|
||||
end service
|
||||
|
||||
Service GetLotCurrOperationName(LotId)
|
||||
CurrOperationId = ''
|
||||
CurrOperationName = ''
|
||||
If LotID NE '' then
|
||||
//Get them in sequence first
|
||||
LotOperationsInSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||
for each LotOperation in LotOperationsInSequence using @FM
|
||||
ThisLotOperationStartDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_IN$, 'X')
|
||||
ThisLotOperationEndDTM = Xlate('LOT_OPERATION', LotOperation, LOT_OPERATION_DATETIME_OUT$, 'X')
|
||||
If ThisLotOperationEndDTM Eq '' then
|
||||
CurrOperationId = LotOperation
|
||||
CurrOperationName = Database_Services('ReadDataColumn', 'LOT_OPERATION', CurrOperationId, LOT_OPERATION_OPERATION_ID$, True$, 0, False$)
|
||||
end
|
||||
until CurrOperationName
|
||||
Next LotOperation
|
||||
end else
|
||||
//error: lot id was null
|
||||
end
|
||||
Response = CurrOperationName
|
||||
end service
|
||||
|
||||
Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
|
||||
ErrorMessage = ''
|
||||
If LotId NE '' then
|
||||
If NewSequence NE '' AND Num(NewSequence) then
|
||||
//Get Current Operations in sequence
|
||||
//CurrSequence = Lot_Services('GetLotOperationSequence', LotId)
|
||||
LotCurrOperation = Lot_Services('GetLotCurrOperation', LotId)
|
||||
LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
|
||||
If CurrOperationSequence LE NewSequence then
|
||||
//Get Curr Operation Sequence
|
||||
@ -526,16 +551,30 @@ Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
|
||||
end
|
||||
end service
|
||||
|
||||
Service MoveInLot(LotID, WaferQty, Operator)
|
||||
Service IsLotMovedIn(LotId)
|
||||
Response = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
CurrOperId = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
CurrOperDtmIn = Database_Services('ReadDataColumn', 'LOT_OPERATION', CurrOperId, LOT_OPERATION_DATETIME_IN$, True$, 0, False$)
|
||||
If CurrOperDtmIn LE Datetime() AND CurrOperDtmIn NE '' then
|
||||
Response = True$
|
||||
end else
|
||||
Response = False$
|
||||
end
|
||||
end
|
||||
end service
|
||||
|
||||
Service MoveInLot(LotID, Operator)
|
||||
debug
|
||||
ErrorMessage = ''
|
||||
ThisLotCurrOperationID = ''
|
||||
If LotId NE '' then
|
||||
If WaferQty NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
WaferQty = ThisLotRec<LOT_WAFER_QTY$>
|
||||
//Possibly Add locking here
|
||||
If Error_Services('NoError') then
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
If ThisLotCurrOperationID NE '' then
|
||||
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_IN$> = Datetime()
|
||||
@ -545,7 +584,7 @@ Service MoveInLot(LotID, WaferQty, Operator)
|
||||
If Error_Services('NoError') then
|
||||
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
|
||||
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_IN', '', '', 0, 0, CurrOperation, Operator)
|
||||
//Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_IN', '', '', 0, 0, CurrOperation, Operator)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
@ -561,9 +600,6 @@ Service MoveInLot(LotID, WaferQty, Operator)
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot ID not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot Qty was not passed to routine.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.'
|
||||
end
|
||||
@ -578,27 +614,15 @@ Service MoveInLot(LotID, WaferQty, Operator)
|
||||
end
|
||||
end service
|
||||
|
||||
Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
Service MoveOutLot(LotID, Operator)
|
||||
ErrorMessage = ''
|
||||
ThisLotCurrOperationID = ''
|
||||
If LotId NE '' then
|
||||
If WaferQty NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ThisLotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
CurrLotQty = ThisLotRec<LOT_WAFER_QTY$>
|
||||
BonusQty = 0
|
||||
ReduceQty = 0
|
||||
If WaferQty NE CurrLotQty then
|
||||
Begin Case
|
||||
Case WaferQty GT CurrLotQty
|
||||
//Addition of wafers
|
||||
BonusQty = WaferQty - CurrLotQty
|
||||
Case WaferQty LT CurrLotQty
|
||||
ReduceQty = CurrLotQty - WaferQty
|
||||
End Case
|
||||
end
|
||||
WaferQty = ThisLotRec<LOT_WAFER_QTY$>
|
||||
If Error_Services('NoError') then
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
If ThisLotCurrOperationID NE '' then
|
||||
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_OUT$> = Datetime()
|
||||
@ -608,7 +632,7 @@ Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
If Error_Services('NoError') then
|
||||
LotType = XLATE('LOT', LotId, LOT_TYPE$, 'X')
|
||||
CurrOperation = XLATE('LOT_OPERATION', ThisLotCurrOperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_OUT', '', '', ReduceQty, BonusQty, CurrOperation, Operator)
|
||||
//Lot_Services('CreateLotEvent', LotId, LotType, Datetime(), 'MOVE_OUT', '', '', ReduceQty, BonusQty, CurrOperation, Operator)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
@ -624,9 +648,6 @@ Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot ID not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot Qty was not passed to routine.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.'
|
||||
end
|
||||
@ -650,14 +671,14 @@ Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
end service
|
||||
|
||||
Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_TYPES, EventNote, EventEquipmentId, ReduceWaferQty, BonusWaferQty, OperationId, OperatorId)
|
||||
|
||||
ErrorMessage = ''
|
||||
BeginWaferQty = ''
|
||||
EndWaferQty = ''
|
||||
ErrorMessage = ''
|
||||
BeginWaferQty = 0
|
||||
EndWaferQty = 0
|
||||
WaferQtyChange = 0
|
||||
If LotId NE '' then
|
||||
Begin Case
|
||||
Case LotType EQ 'TW'
|
||||
If EventType NE '' AND OperatorId NE '' then
|
||||
If OperatorId NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
ValidId = False$
|
||||
NewEventId = ''
|
||||
@ -670,40 +691,101 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
Repeat
|
||||
BeginWaferQty = Xlate('LOT', LotId, LOT_WAFER_QTY$, 'X')
|
||||
If OperationID EQ '' then
|
||||
OperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
OperationID = XLATE('LOT_OPERATION', OperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
OperationID = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
//CurrOperationName = XLATE('LOT_OPERATION', OperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
end
|
||||
//OperationId should be set by now, if not, it is an error. Raise the error and cancel any processing.
|
||||
If OperationID NE '' then
|
||||
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
|
||||
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('HasError') then
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Error writing Lot Event record, ' : Error_Services('GetMessage')
|
||||
end
|
||||
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)
|
||||
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'
|
||||
//Do nothing for now.
|
||||
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 Error_Services('HasError') then
|
||||
* ErrorMessage = Error_Services('GetMessage')
|
||||
* end
|
||||
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
|
||||
@ -711,7 +793,7 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
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, Missing event type or Operator ID.'
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Operator ID was null.'
|
||||
end
|
||||
Case LotType EQ 'RDS'
|
||||
If EventType NE '' AND OperatorId NE '' then
|
||||
@ -854,7 +936,7 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||
SRP_JSON(objLot, 'SetValue', 'VendorPartNo', LotRec<LOT_VENDOR_PART_NO$>)
|
||||
SRP_JSON(objLot, 'SetValue', 'VendorLotNo', LotRec<LOT_VENDOR_LOT_NO$>)
|
||||
SRP_JSON(objLot, 'SetValue', 'Vendor', LotRec<LOT_VENDOR_CODE$>)
|
||||
CurrOperation = Lot_Services('GetLotCurrOperation', LotId)
|
||||
CurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
CurrOperation = Field(CurrOperation, '*', 2)
|
||||
SRP_JSON(objLot, 'SetValue', 'CurrOperation', CurrOperation)
|
||||
If FullObject then
|
||||
@ -978,11 +1060,70 @@ Service CloseLot(LotId)
|
||||
end
|
||||
end service
|
||||
|
||||
Service HoldLot(LotId)
|
||||
Service HoldLot(LotId, OperatorId)
|
||||
|
||||
end service
|
||||
|
||||
Service UnholdLot(LotId)
|
||||
Service UnholdLot(LotId, OperatorId)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
Service ReduceLotWaferCount(LotId, ReductionQty)
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
LotCurrWfrQty = LotRec<LOT_WAFER_QTY$>
|
||||
LotNewWfrQty = LotCurrWfrQty - ReductionQty
|
||||
If LotNewWfrQty LE 25 AND LotNewWfrQty GE 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.'
|
||||
end
|
||||
end else
|
||||
Begin Case
|
||||
Case LotNewWfrQty GT 25
|
||||
ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity great than 25.'
|
||||
Case LotNewWfrQty LT 0
|
||||
ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity less than 0.'
|
||||
End Case
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Reduce Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.'
|
||||
end
|
||||
if ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service IncreaseLotWaferCount(LotId, IncreaseQty)
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
LotCurrWfrQty = LotRec<LOT_WAFER_QTY$>
|
||||
LotNewWfrQty = LotCurrWfrQty + 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.'
|
||||
end
|
||||
end else
|
||||
Begin Case
|
||||
Case LotNewWfrQty GT 25
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity great than 25.'
|
||||
Case LotNewWfrQty LT 0
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' cannot have a quantity less than 0.'
|
||||
End Case
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Lot Id ' : LotId : ' not found in lot table.'
|
||||
end
|
||||
if ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user