fixed bug in mu auto hold system

This commit is contained in:
Infineon\StieberD 2025-02-13 12:50:12 -07:00
parent 3ba7ffe782
commit 30bd03049a
2 changed files with 251 additions and 246 deletions

View File

@ -142,9 +142,6 @@ READONLY_RECORD:
return return
WRITE_RECORD_PRE: WRITE_RECORD_PRE:
SaveRecord<MAKEUP_WAFERS.EXPIRED$> = ( {UNLOAD_DTM} LT SRP_Date('AddYears', Date(), -3) )
return return
WRITE_RECORD: WRITE_RECORD:
@ -204,3 +201,4 @@ return

View File

@ -273,8 +273,10 @@ Service ProcessAutoHold()
HoldList = '' HoldList = ''
FailedHoldList = '' FailedHoldList = ''
CutoffDate = SRP_Date('AddYears', Date(), -3) HoldEntityIds = ''
Query = 'SELECT MAKEUP_WAFERS WITH UNLOAD_DTM LT ':Quote(OConv(CutoffDate, 'DT2/^H'): ' AND WITH EXPIRED NE ':True$)
CuttoffDtm = SRP_Datetime('AddYears', Datetime(), -3)
Query = 'SELECT MAKEUP_WAFERS WITH UNLOAD_DTM LT ':Quote(OConv(CuttoffDtm, 'DT2/^H')): ' AND WITH EXPIRED NE ':True$
Flag = '' Flag = ''
RList(Query, TARGET_ACTIVELIST$, '', '', Flag) RList(Query, TARGET_ACTIVELIST$, '', '', Flag)
@ -363,11 +365,17 @@ Service ProcessAutoHold()
end end
If ErrorMsg EQ '' then If ErrorMsg EQ '' then
// Now mark cassette as expired // Now mark cassette as expired
MWRec = Database_Services('ReadDataRow', 'MAKEUP_WAFERS', WOMatKey)
ExpiredFlag = MWRec<MAKEUP_WAFERS.EXPIRED$>
LogData = '' LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H') LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'Attempting to mark lot "':WOMatKey:'" as expired.' LogData<2> = 'Checking expiry state of "':WOMatKey:'". Expired flag = ':ExpiredFlag:'.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
If ExpiredFlag NE True$ then
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'Lot "':WOMatKey:'" not marked as expired. Attempting to mark lot "':WOMatKey:'" as expired.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM) Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
Material_Services('MarkMUCassExpired', WOMatKey) Material_Services('MarkMUCassExpired', WOMatKey)
If Error_Services('NoError') then If Error_Services('NoError') then
MWRec = Database_Services('ReadDataRow', 'MAKEUP_WAFERS', WOMatKey) MWRec = Database_Services('ReadDataRow', 'MAKEUP_WAFERS', WOMatKey)
@ -395,6 +403,12 @@ Service ProcessAutoHold()
LogData<2> = LogMsg LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM) Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end end
end else
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'Lot "':WOMatKey:'" already marked as expired. Expired flag = ':ExpiredFlag:'.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
end else end else
ErrorMsg = Error_Services('GetMessage') ErrorMsg = Error_Services('GetMessage')
LogMsg = 'Failed to toggle hold state of lot "':WOMatKey:'".' LogMsg = 'Failed to toggle hold state of lot "':WOMatKey:'".'
@ -416,6 +430,7 @@ Service ProcessAutoHold()
If (ErrorMsg EQ '') then If (ErrorMsg EQ '') then
HoldList<-1> = ReactType:TAB$:HoldEntityID HoldList<-1> = ReactType:TAB$:HoldEntityID
HoldEntityIds<-1> = WOMatKey
end else end else
FailedHoldList<-1> = ReactType:TAB$:HoldEntityID FailedHoldList<-1> = ReactType:TAB$:HoldEntityID
end end
@ -425,7 +440,7 @@ Service ProcessAutoHold()
NotifyDtm = Datetime() NotifyDtm = Datetime()
// Send initial notification of successful lots and failed lots // Send initial notification of successful lots and failed lots
If (HoldList NE '') then If (HoldEntityIds NE '') then
Recipients = '' Recipients = ''
SentFrom = 'SYSTEM' SentFrom = 'SYSTEM'
Subject = 'Makeup Wafer Auto-Hold Report' Subject = 'Makeup Wafer Auto-Hold Report'
@ -439,16 +454,8 @@ Service ProcessAutoHold()
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms) obj_Notes('Create',Parms)
For each WOMatKey in HoldList using @FM For each HoldEntityId in HoldEntityIds using @FM
WOMatKey = HoldEntityId
WONo = Field(WOMatKey, '*', 1)
ReactType = Xlate('WO_LOG', WONo, 'REACT_TYPE', 'X')
If ReactType EQ 'EPP' then
CassNo = Field(WOMatKey, '*', 2)
HoldEntityID = WONo:'*1*':CassNo
end else
HoldEntityID = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
end
MUWfrRec = Database_Services('ReadDataRow', 'MAKEUP_WAFERS', WOMatKey) MUWfrRec = Database_Services('ReadDataRow', 'MAKEUP_WAFERS', WOMatKey)
If Error_Services('NoError') then If Error_Services('NoError') then
HaveLock = Database_Services('GetKeyIDLock', 'MAKEUP_WAFERS', WOMatKey, True$) HaveLock = Database_Services('GetKeyIDLock', 'MAKEUP_WAFERS', WOMatKey, True$)
@ -488,7 +495,7 @@ Service ProcessAutoHold()
LogData<2> = LogMsg LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM) Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end end
Next WOMatKey Next HoldEntityId
end end
If (FailedHoldList NE '') then If (FailedHoldList NE '') then