Added in functionality for TW WIP Reporting
Refactored error logging and catching.
This commit is contained in:
committed by
Ouellette Jonathan (CSC FI SPS MESLEO)
parent
0ec0428f19
commit
508707f0f2
@ -2,15 +2,32 @@ 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
|
||||
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json
|
||||
$insert LOGICAL
|
||||
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services
|
||||
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services
|
||||
$insert APP_INSERTS
|
||||
$Insert LOT_EQUATES
|
||||
$Insert TEST_WAFER_PROD_EQUATES
|
||||
$Insert Lot_Operation_Equates
|
||||
$Insert PRODUCT_OPERATION_EQUATES
|
||||
$Insert LOT_EVENT_EQUATES
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Lot'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' TestWaferLotCreation.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'Product Name' : @FM : 'Username' : @FM : 'Message'
|
||||
objTWCreationLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotMove.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Username' : @FM : 'Message'
|
||||
objLotMoveLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, ',', Headers, '', False$, False$)
|
||||
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' LotEvent.csv'
|
||||
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'
|
||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN'
|
||||
|
||||
@ -96,35 +113,56 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
||||
ThisLotCurrOpId = Lot_Services('GetLotCurrOperation', CreatedLotNumber)
|
||||
If ThisLotCurrOpId NE '' then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
If PrinterID NE 'WEB' then
|
||||
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
|
||||
if Error_Services('NoError') then
|
||||
//Set lot to open
|
||||
Lot_Services('OpenLot', CreatedLotNumber)
|
||||
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.
|
||||
Labeling_Services('PrintTestWaferLotLabel', CreatedLotNumber, Username, PrinterID)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : CreatedLotNumber : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
Lot_Services('MoveOutLot', NewLotId, LotQty, Username)
|
||||
If Error_Services('NoError') then
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
Lot_Services('MoveOutLot', NewLotId, LotQty, Username)
|
||||
Lot_Services('MoveInLot', NewLotId, LotQty, Username)
|
||||
end else
|
||||
//Error: Error getting current operation
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, error getting current operation for lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
//Error: Failed to initialize lot operations
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, lot id: ' : NewLotId : ' , ' : Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
end else
|
||||
//Lot attributes didn't write correctly.
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot attributes did not write correctly for lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
//Error: Lot already had data
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Lot already had data, lot: ' : NewLotId
|
||||
end
|
||||
end else
|
||||
//Error creating new lot ID
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, Created lot: ' : NewLotId : ' not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
//Error getting new Lot ID
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, no lot id returned.'
|
||||
end
|
||||
end else
|
||||
//Ambiguous Product name, multiple results.
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, ambiguous product passed to routine OR no matching products found.'
|
||||
end
|
||||
end else
|
||||
//No Matching part no found
|
||||
ErrorMessage = 'Error in Create New Test Wafer Lot Process, product(':ProdName:') passed to routine not found.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Null value passed in for ProdID'
|
||||
@ -132,11 +170,27 @@ Service CreateNewTestWaferLot(LotType, ProdName, LotQty, VendorPartNo, VendorLot
|
||||
end else
|
||||
ErrorMessage = 'Lot type was not test wafer'
|
||||
end
|
||||
If ErrorMessage EQ '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = ProdName
|
||||
LogData<3> = Username
|
||||
LogData<4> = 'Successfully created lot id ' : CreatedLotNumber : ' of product type ' : ProdName '.'
|
||||
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
||||
end else
|
||||
Error_Services('Add', ErrorMessage)
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = ProdName
|
||||
LogData<3> = Username
|
||||
LogData<4> = ErrorMessage
|
||||
Logging_Services('AppendLog', objTWCreationLog, LogData, @RM, @FM, False$)
|
||||
end
|
||||
Response = CreatedLotNumber
|
||||
|
||||
End Service
|
||||
|
||||
Service GenerateInitialLotOperationRecords(LotId)
|
||||
ErrorMessage = ''
|
||||
If LotID NE '' then
|
||||
if RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
@ -151,19 +205,22 @@ Service GenerateInitialLotOperationRecords(LotId)
|
||||
//NewOperationRecID =
|
||||
Next operation
|
||||
end else
|
||||
//Error: No Operations returned
|
||||
ErrorMessage = 'No Operations found for ' : ProdId
|
||||
end
|
||||
end else
|
||||
//Error: Prod ID for lot is null
|
||||
ErrorMessage = 'Prod ID not specified'
|
||||
end
|
||||
//ID will be LotNum + OperationID
|
||||
//Get product operations
|
||||
|
||||
end else
|
||||
//error: lot does not exist
|
||||
ErrorMessage = 'Lot ID does not exist.'
|
||||
end
|
||||
end else
|
||||
//error: null lot id
|
||||
ErrorMessage = 'Lot ID was null'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
@ -184,35 +241,43 @@ Service GetPrescribedOperationsByProdId(ProdId, ProdType)
|
||||
end service
|
||||
|
||||
Service CreateInitialLotOperationRecords(LotId)
|
||||
ErrorMessage = ''
|
||||
If LotId NE '' then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
LotType = LotRec<LOT_TYPE$>
|
||||
ProdId = LotRec<LOT_PROD_ID$>
|
||||
ThisInitialProdOperations = Lot_Services('GetPrescribedOperationsByProdId', ProdId, LotType)
|
||||
For each ProdOperation in ThisInitialProdOperations using @VM
|
||||
If Error_Services('NoError') AND ThisInitialProdOperations NE '' then
|
||||
For each ProdOperation in ThisInitialProdOperations using @VM
|
||||
|
||||
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
||||
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
||||
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
||||
|
||||
LotOperationRecID = LotId : '*' : OperationID
|
||||
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
||||
LotOperationRec = ''
|
||||
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationID
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = OperationSequence
|
||||
LotOperationRec<LOT_OPERATION_REWORK$> = False$
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
end else
|
||||
//Error: Lot Operation already existed, cannot overwrite
|
||||
end
|
||||
|
||||
Next Operation
|
||||
ProdOperationRec = Database_Services('ReadDataRow', 'PRODUCT_OPERATION', ProdOperation)
|
||||
OperationID = ProdOperationRec<PRODUCT_OPERATION_OPERATION_ID$>
|
||||
OperationSequence = ProdOperationRec<PRODUCT_OPERATION_OPERATION_SEQUENCE$>
|
||||
|
||||
LotOperationRecID = LotId : '*' : OperationID
|
||||
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
|
||||
LotOperationRec = ''
|
||||
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationID
|
||||
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = OperationSequence
|
||||
LotOperationRec<LOT_OPERATION_REWORK$> = False$
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
|
||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
end else
|
||||
ErrorMessage = 'Lot Operation already existed, cannot overwrite'
|
||||
end
|
||||
|
||||
Next Operation
|
||||
end else
|
||||
ErrorMessage = 'Error getting prescribed operations for lot# ' : LotId
|
||||
end
|
||||
|
||||
end else
|
||||
//Error: Lot ID was null
|
||||
ErrorMessage = 'Lot ID was null'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
TestRec = Database_Services('ReadDataRow', 'LOT', LotId)
|
||||
end service
|
||||
|
||||
//Returns a @FM delimited list of operations in sequence
|
||||
@ -323,6 +388,8 @@ Service AddLotOperationIntoSequence(LotId, NewOperationId, NewSequence, Rework)
|
||||
end service
|
||||
|
||||
Service MoveInLot(LotID, WaferQty, Operator)
|
||||
ErrorMessage = ''
|
||||
ThisLotCurrOperationID = ''
|
||||
If LotId NE '' then
|
||||
If WaferQty NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
@ -340,26 +407,41 @@ Service MoveInLot(LotID, WaferQty, Operator)
|
||||
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)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Error getting lots current operation.'
|
||||
end
|
||||
|
||||
//Log to Lot Event Table
|
||||
end else
|
||||
//Error: Error reading record
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
|
||||
end else
|
||||
//Error Invalid Lot id entered
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot ID not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
//Error: Wafer Qty was null
|
||||
ErrorMessage = 'Error in Move In process for Lot id ' : LotId : '. Lot Qty was not passed to routine.'
|
||||
end
|
||||
end else
|
||||
//Error: Lot Id was null
|
||||
ErrorMessage = 'Error in Move In process. Lot id was not passed to routine.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotID
|
||||
LogData<3> = Operator
|
||||
LogData<4> = 'Successfully Moved Lot into operation ' : ThisLotCurrOperationID : '.'
|
||||
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
ErrorMessage = ''
|
||||
ThisLotCurrOperationID = ''
|
||||
If LotId NE '' then
|
||||
If WaferQty NE '' then
|
||||
If RowExists('LOT', LotId) then
|
||||
@ -376,7 +458,6 @@ Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
ReduceQty = CurrLotQty - WaferQty
|
||||
End Case
|
||||
end
|
||||
//Possibly Add locking here
|
||||
If Error_Services('NoError') then
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
If ThisLotCurrOperationID NE '' then
|
||||
@ -387,28 +468,52 @@ Service MoveOutLot(LotID, WaferQty, Operator)
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotCurrOperationID, ThisLotCurrOperationRec)
|
||||
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)
|
||||
If Error_Services('HasError') then
|
||||
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')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error getting lots current operation.'
|
||||
end
|
||||
//Log to lot event table.
|
||||
end else
|
||||
//Error: Error reading record
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. ' : Error_Services('GetMessage')
|
||||
end
|
||||
|
||||
end else
|
||||
//Error Invalid Lot id entered
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot ID not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
//Error: Wafer Qty was null
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Lot Qty was not passed to routine.'
|
||||
end
|
||||
end else
|
||||
//Error: Lot Id was null
|
||||
ErrorMessage = 'Error in Move Out process. Lot id was not passed to routine.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotID
|
||||
LogData<3> = Operator
|
||||
LogData<4> = 'Successfully Moved Lot out of operation ' : ThisLotCurrOperationID : '.'
|
||||
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end else
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotID
|
||||
LogData<3> = Operator
|
||||
LogData<4> = 'Error in Move Out process for Lot id ' : LotId : '. ' : ErrorMessage
|
||||
Logging_Services('AppendLog', objLotMoveLog, LogData, @RM, @FM, False$)
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_TYPES, EventNote, EventEquipmentId, ReduceWaferQty, BonusWaferQty, OperationId, OperatorId)
|
||||
ErrorMessage = ''
|
||||
BeginWaferQty = ''
|
||||
EndWaferQty = ''
|
||||
If LotId NE '' then
|
||||
Begin Case
|
||||
Case LotType EQ 'TW'
|
||||
@ -428,49 +533,83 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
OperationID = Lot_Services('GetLotCurrOperation', LotId)
|
||||
OperationID = XLATE('LOT_OPERATION', OperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
end
|
||||
If ReduceWaferQty NE '' then
|
||||
If Num(ReduceWaferQty) then
|
||||
EndWaferQty = BeginWaferQty - ReduceWaferQty
|
||||
//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
|
||||
end
|
||||
If BonusWaferQty NE '' then
|
||||
If Num(BonusWaferQty) then
|
||||
EndWaferQty = BeginWaferQty + BonusWaferQty
|
||||
If BonusWaferQty NE '' then
|
||||
If Num(BonusWaferQty) then
|
||||
EndWaferQty = BeginWaferQty + BonusWaferQty
|
||||
end
|
||||
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
|
||||
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)
|
||||
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
|
||||
end else
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Current Operation for lot id ' : LotId : ' could not be determined.'
|
||||
end
|
||||
end else
|
||||
//Error: Nonexistent Lot Id passed to routine
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot Id passed to routine was not found in LOT table.'
|
||||
end
|
||||
end else
|
||||
//Error Missing Parameter
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Missing event type or Operator ID.'
|
||||
end
|
||||
Case LotType EQ 'RDS'
|
||||
null
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot type RDS was passed to routine and this is currently not supported.'
|
||||
Case LotType EQ 'WM_OUT'
|
||||
null
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot type WM_OUT was passed to routine and this is currently not supported.'
|
||||
Case LotType EQ 'WM_IN'
|
||||
null
|
||||
ErrorMessage = 'Error in Create Lot Event routine, Lot type WM_IN was passed to routine and this is currently not supported.'
|
||||
Case Otherwise$
|
||||
//Error: Invalid LotType Passed to routine
|
||||
ErrorMessage = 'Error in Create Lot Event routine, An invalid lot type was passed to routine.'
|
||||
End Case
|
||||
end else
|
||||
//Error: Lot ID was null
|
||||
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
|
||||
|
||||
@ -525,6 +664,10 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||
SRP_JSON(objLot, 'SetValue', 'WaferQty', LotRec<LOT_WAFER_QTY$>)
|
||||
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 = Field(CurrOperation, '*', 2)
|
||||
SRP_JSON(objLot, 'SetValue', 'CurrOperation', CurrOperation)
|
||||
If FullObject then
|
||||
//Events Array
|
||||
EventsArrayJson = ''
|
||||
@ -612,4 +755,47 @@ Service ConvertLotRecordToJson(LotId, ItemURL, CurrUser, FullObject=BOOLEAN)
|
||||
Response = JsonString
|
||||
end service
|
||||
|
||||
Service OpenLot(LotId)
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
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')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Unable to Open Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service CloseLot(LotId)
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
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')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Unable to Close Lot ' : LotId : '. Lot ID was not found in LOT table.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service HoldLot(LotId)
|
||||
|
||||
end service
|
||||
|
||||
Service UnholdLot(LotId)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user