Merged PR 13301: Added test wafer auto close routines upon zero wafer quantity.
Added test wafer auto close routines upon zero wafer quantity.
This commit is contained in:
parent
c50e536791
commit
7a633a6cb5
@ -2,15 +2,16 @@ 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
|
||||
Declare function SRP_Array, SRP_Json, Environment_Services, Logging_Services, MemberOf
|
||||
Declare subroutine Database_Services, Btree.Extract, Lot_Services, Error_Services, Labeling_Services, SRP_Json, Logging_Services
|
||||
Declare subroutine SRP_Run_Command
|
||||
Declare subroutine SRP_Run_Command, Service_Services, obj_notes
|
||||
$insert APP_INSERTS
|
||||
$Insert LOT_EQUATES
|
||||
$Insert TEST_WAFER_PROD_EQUATES
|
||||
$Insert Lot_Operation_Equates
|
||||
$Insert PRODUCT_OPERATION_EQUATES
|
||||
$Insert LOT_EVENT_EQUATES
|
||||
$Insert NOTIFICATION_EQUATES
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Lot'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
@ -29,6 +30,10 @@ 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$)
|
||||
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' TWLotClosure.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'Lot Id' : @FM : 'Operator' : @FM : 'Message'
|
||||
objLotClosureLog = 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', 'TW_USE', 'CLOSE'
|
||||
Options LOT_TYPES = 'TW', 'RDS', 'WM_OUT', 'WM_IN'
|
||||
|
||||
@ -568,6 +573,21 @@ Service IsLotMovedIn(LotId)
|
||||
end
|
||||
end service
|
||||
|
||||
Service IsOperationCompleted(LotOperationId)
|
||||
OperationCompleted = False$
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||
LotOperationDateTimeOut = Database_Services('ReadDataColumn', 'LOT_OPERATION', LotOperationId, LOT_OPERATION_DATETIME_OUT$, True$, 0, False$)
|
||||
If LotOperationDateTimeOut NE '' then OperationCompleted = true$
|
||||
end else
|
||||
ErrorMessage = 'Invalid lot operation id passed to routine.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', 'Error in ' : service : ' with Lot OperationId ' : LotOperationId : ' : ' : ErrorMessage)
|
||||
end
|
||||
response = OperationCompleted
|
||||
end service
|
||||
|
||||
Service MoveInLot(LotID, Operator)
|
||||
ErrorMessage = ''
|
||||
ThisLotCurrOperationID = ''
|
||||
@ -626,6 +646,7 @@ Service MoveOutLot(LotID, Operator)
|
||||
If Error_Services('NoError') then
|
||||
ThisLotCurrOperationID = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
If ThisLotCurrOperationID NE '' then
|
||||
If Lot_Services('IsLotMovedIn', LotId) then
|
||||
ThisLotCurrOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotCurrOperationID)
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_DATETIME_OUT$> = Datetime()
|
||||
ThisLotCurrOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> = WaferQty
|
||||
@ -640,6 +661,10 @@ Service MoveOutLot(LotID, Operator)
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error writing to lot operation record. ' : Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
CurrOperationName = Field(ThisLotCurrOperationID, '*', 2)
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Cannot move out lot from ' :CurrOperationName: ' because it is not moved in.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Move Out process for Lot id ' : LotId : '. Error getting lots current operation.'
|
||||
end
|
||||
@ -696,7 +721,7 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
//CurrOperationName = XLATE('LOT_OPERATION', OperationID, LOT_OPERATION_OPERATION_ID$, 'X')
|
||||
end
|
||||
If OperationID NE '' then
|
||||
*
|
||||
*
|
||||
|
||||
Begin Case
|
||||
Case EventType EQ 'MOVE_IN'
|
||||
@ -728,7 +753,7 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Case EventType EQ 'REDUCE_WAFER_QTY'
|
||||
Lot_Services('ReduceLotWaferCount', LotId, ReduceWaferQty)
|
||||
Lot_Services('ReduceLotWaferCount', LotId, ReduceWaferQty, OperatorId)
|
||||
If Error_Services('NoError') then
|
||||
|
||||
end else
|
||||
@ -746,7 +771,7 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
Case EventType EQ 'LOCATION'
|
||||
//Do nothing for now.
|
||||
Case EventType EQ 'CLOSE'
|
||||
Lot_Services('CloseLot', LotId)
|
||||
Lot_Services('CloseLot', LotId, OperatorId)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = 'Error in Create Lot Event routine, ' : Error_Services('GetMessage')
|
||||
end
|
||||
@ -758,9 +783,9 @@ Service CreateLotEvent(LotId, LotType=LOT_TYPES, EventDatetime, EventType=EVENT_
|
||||
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 Error_Services('HasError') then
|
||||
* ErrorMessage = Error_Services('GetMessage')
|
||||
* end
|
||||
If ErrorMessage EQ '' then
|
||||
EndWaferQty = (BeginWaferQty + BonusWaferQty) - ReduceWaferQty
|
||||
|
||||
@ -1069,6 +1094,101 @@ Service CloseLot(LotId)
|
||||
end
|
||||
end service
|
||||
|
||||
Service AutoCloseTestWaferLot(LotId, CloseUserId)
|
||||
AutoCloseTime = Datetime()
|
||||
ErrorMessage = ''
|
||||
If MemberOf(CloseUserId, 'LEAD') OR MemberOf(CloseUserId, 'SUPERVISOR') OR CloseUserId EQ 'SYSTEM' then
|
||||
LotOperations = Lot_Services('GetLotOperationSequence', LotId)
|
||||
for LotOperationIndex = 1 to DCount(LotOperations, @FM)
|
||||
ThisLotOperationId = LotOperations<LotOperationIndex>
|
||||
ThisOperationCompleted = Lot_Services('IsOperationCompleted', ThisLotOperationId)
|
||||
If Error_Services('NoError') then
|
||||
if Not(ThisOperationCompleted) then
|
||||
ThisLotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', ThisLotOperationId)
|
||||
if Error_Services('NoError') then
|
||||
CurrLotQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$)
|
||||
If ThisLotOperationRec<LOT_OPERATION_DATETIME_IN$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_DATETIME_IN$> = AutoCloseTime
|
||||
end
|
||||
If ThisLotOperationRec<LOT_OPERATION_DATETIME_OUT$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_DATETIME_OUT$> = AutoCloseTime
|
||||
end
|
||||
if ThisLotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_OPERATOR_IN_ID$> = CloseUserId
|
||||
end
|
||||
if ThisLotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_OPERATOR_OUT_ID$> = CloseUserId
|
||||
end
|
||||
if ThisLotOperationRec<LOT_OPERATION_DATETIME_START$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_DATETIME_START$> = AutoCloseTime
|
||||
end
|
||||
if ThisLotOperationRec<LOT_OPERATION_DATETIME_STOP$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_DATETIME_STOP$> = AutoCloseTime
|
||||
end
|
||||
If ThisLotOperationRec<LOT_OPERATION_WAFER_IN_QTY$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_WAFER_IN_QTY$> = CurrLotQty
|
||||
end
|
||||
If ThisLotOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> EQ '' then
|
||||
ThisLotOperationRec<LOT_OPERATION_WAFER_OUT_QTY$> = CurrLotQty
|
||||
end
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', ThisLotOperationId, ThisLotOperationRec, True$, False$, False$)
|
||||
If Error_Services('HasError') then
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
Next LotOperationIndex
|
||||
end else
|
||||
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)
|
||||
If Error_Services('NoError') then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotId
|
||||
LogData<3> = CloseUserId
|
||||
LogData<4> = 'Successfully marked lot as closed.'
|
||||
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotId
|
||||
LogData<3> = CloseUserId
|
||||
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
|
||||
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
||||
//Send a message to FI
|
||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
||||
SentFrom = 'SYSTEM'
|
||||
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
||||
Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to set CLOSE flag on lot. ' : ErrorMessage
|
||||
Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message)
|
||||
Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage)
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = LotId
|
||||
LogData<3> = CloseUserId
|
||||
LogData<4> = 'Error marking lot as closed.' : ErrorMessage
|
||||
Logging_Services('AppendLog', objLotClosureLog, LogData, @RM, @FM, False$)
|
||||
//Send a message to FI
|
||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
||||
SentFrom = 'SYSTEM'
|
||||
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
||||
Message = 'Error in ' : service : ' with lot id ' : LotId : ' attempting to Auto Close Lot. ' : ErrorMessage
|
||||
Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message)
|
||||
Error_Services('Add', 'Error in ' : service : ' with lot ' : LotId : ':' : ErrorMessage)
|
||||
end
|
||||
end service
|
||||
|
||||
Service HoldLot(LotId, OperatorId)
|
||||
|
||||
end service
|
||||
@ -1078,10 +1198,11 @@ Service UnholdLot(LotId, OperatorId)
|
||||
end service
|
||||
|
||||
|
||||
Service ReduceLotWaferCount(LotId, ReductionQty)
|
||||
Service ReduceLotWaferCount(LotId, ReductionQty, OperatorId)
|
||||
ErrorMessage = ''
|
||||
If RowExists('LOT', LotId) then
|
||||
LotRec = Database_Services('ReadDataRow', 'LOT', LotId, True$, 0, False$)
|
||||
LotType = LotRec<LOT_TYPE$>
|
||||
LotHold = LotRec<LOT_HOLD$>
|
||||
LotOpen = LotRec<LOT_OPEN$>
|
||||
LotCurrWfrQty = LotRec<LOT_WAFER_QTY$>
|
||||
@ -1089,7 +1210,22 @@ Service ReduceLotWaferCount(LotId, 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('NoError') then
|
||||
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
|
||||
Recipients = Xlate('NOTIFICATION', 'FI_SUPPORT', NOTIFICATION_USER_ID$, 'X')
|
||||
SentFrom = 'SYSTEM'
|
||||
Subject = 'TEST WAFER LOT AUTO-CLOSURE FAILURE'
|
||||
Message = 'Error in ' : service : ' attempting to add auto lot closure for lot id ' : LotId : ' to the service queue.'
|
||||
AttachWindow = ''
|
||||
AttachKeys = ''
|
||||
SendToGroup = ''
|
||||
Obj_Notes('Create',Recipients:@RM:SentFrom:@RM:Subject:@RM:Message)
|
||||
end
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'Error in Increase Lot Wafer Count service, Error writing Lot Id ' : LotId : ' with new quantity.'
|
||||
end
|
||||
end else
|
||||
@ -1156,3 +1292,4 @@ end service
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user