updated auto-hold service to resend notifications every 12 hours if expired mu cassette is not NCRd

This commit is contained in:
Infineon\StieberD 2025-01-23 12:37:21 -07:00
parent bdd3c84a78
commit 864355dfc2
2 changed files with 158 additions and 27 deletions

View File

@ -266,12 +266,6 @@ End Service
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service ProcessAutoHold() Service ProcessAutoHold()
// Service should run once a day or less
// First find subset of Makeup lots that are over 3 years old (age based on date out)
// From above list,
// 1) Put affected lots on hold and
// 2) Send notification to notification group
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS') hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID then Lock hSysLists, ServiceKeyID then
@ -283,7 +277,7 @@ Service ProcessAutoHold()
HoldList = '' HoldList = ''
FailedHoldList = '' FailedHoldList = ''
CutoffDate = SRP_Date('AddYears', Date(), -3) CutoffDate = SRP_Date('AddYears', Date(), -3)
Query = 'SELECT MAKEUP_WAFERS WITH UNLOAD_DTM LT ':Quote(OConv(CutoffDate, 'DT2/^H')) Query = 'SELECT MAKEUP_WAFERS WITH UNLOAD_DTM LT ':Quote(OConv(CutoffDate, 'DT2/^H'): ' AND WITH EXPIRED NE ':True$)
Flag = '' Flag = ''
RList(Query, TARGET_ACTIVELIST$, '', '', Flag) RList(Query, TARGET_ACTIVELIST$, '', '', Flag)
@ -431,7 +425,9 @@ Service ProcessAutoHold()
Repeat Repeat
// Send notification of successful lots and failed lots NotifyDtm = Datetime()
// Send initial notification of successful lots and failed lots
If (HoldList NE '') then If (HoldList NE '') then
Recipients = '' Recipients = ''
SentFrom = 'SYSTEM' SentFrom = 'SYSTEM'
@ -445,6 +441,57 @@ Service ProcessAutoHold()
Message := HoldList Message := HoldList
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
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)
If Error_Services('NoError') then
HaveLock = Database_Services('GetKeyIDLock', 'MAKEUP_WAFERS', WOMatKey, True$)
If HaveLock then
MUWfrRec<MAKEUP_WAFERS.EXPIRY_LAST_NOTIFY_DTM$> = NotifyDtm
Database_Services('WriteDataRow', 'MAKEUP_WAFERS', WOMatKey, MUWfrRec, True$, False$, False$)
If Error_Services('NoError') then
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'Updated expiry notify dtm for expired lot "':WOMatKey:'".'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end else
ErrorMsg = Error_Services('GetMessage')
LogMsg = 'Failed to update expiry notify dtm for expired lot "':WOMatKey:'". Error updating MAKEUP_WAFERS record.'
LogMsg := 'Error message: ':ErrorMsg
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
SelfLocked = Database_Services('IsKeyIDSelfLocked', 'MAKEUP_WAFERS', WOMatKey)
If SelfLocked then Database_Services('ReleaseKeyIDLock', 'MAKEUP_WAFERS', WOMatKey)
end
end else
LogMsg = 'MAKEUP_WAFERS record for expired lot "':WOMatKey:'" is locked. Service will attempt again on next service call.'
LogMsg := 'Error message: ':ErrorMsg
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
end else
ErrorMsg = Error_Services('GetMessage')
LogMsg = 'Failed to send notification for expired lot "':WOMatKey:'". Error reading MAKEUP_WAFERS record.'
LogMsg := 'Error message: ':ErrorMsg
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
Next WOMatKey
end end
If (FailedHoldList NE '') then If (FailedHoldList NE '') then
@ -462,6 +509,88 @@ Service ProcessAutoHold()
obj_Notes('Create',Parms) obj_Notes('Create',Parms)
end end
// Send reminders of expired lots not yet NCR'd, which should trigger deletion of MAKEUP_WAFERS record when quantity reaches zero.
NotifyList = ''
ThresholdDtm = SRP_Datetime('AddHours', Datetime(), -12)
ThresholdDtm = OConv(ThresholdDtm, 'DT2/^H')
Query = 'SELECT MAKEUP_WAFERS WITH EXPIRED EQ ':True$:' AND WITH EXPIRY_LAST_NOTIFY_DTM LT ':Quote(ThresholdDtm)
Flag = ''
RList(Query, TARGET_ACTIVELIST$, '', '', Flag)
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'Notification RList Flag = ':Flag:'. @RecCount = ':@RecCount
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
EOF = False$
Loop
Readnext WOMatKey else EOF = True$
Until EOF
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)
If Error_Services('NoError') then
HaveLock = Database_Services('GetKeyIDLock', 'MAKEUP_WAFERS', WOMatKey, True$)
If HaveLock then
MUWfrRec<MAKEUP_WAFERS.EXPIRY_LAST_NOTIFY_DTM$> = NotifyDtm
Database_Services('WriteDataRow', 'MAKEUP_WAFERS', WOMatKey, MUWfrRec, True$, False$, False$)
If Error_Services('NoError') then
NotifyList<-1> = ReactType:TAB$:HoldEntityID
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'Updated expiry notify dtm for expired lot "':WOMatKey:'".'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end else
ErrorMsg = Error_Services('GetMessage')
LogMsg = 'Failed to send notification for expired lot "':WOMatKey:'". Error updating MAKEUP_WAFERS record.'
LogMsg := 'Error message: ':ErrorMsg
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
SelfLocked = Database_Services('IsKeyIDSelfLocked', 'MAKEUP_WAFERS', WOMatKey)
If SelfLocked then Database_Services('ReleaseKeyIDLock', 'MAKEUP_WAFERS', WOMatKey)
end
end else
LogMsg = 'MAKEUP_WAFERS record for expired lot "':WOMatKey:'" is locked. Service will attempt again on next service call.'
LogMsg := 'Error message: ':ErrorMsg
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
end else
ErrorMsg = Error_Services('GetMessage')
LogMsg = 'Failed to send notification for expired lot "':WOMatKey:'". Error reading MAKEUP_WAFERS record.'
LogMsg := 'Error message: ':ErrorMsg
LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = LogMsg
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
Repeat
If (NotifyList NE '') then
Recipients = ''
SentFrom = 'SYSTEM'
Subject = 'Makeup Wafer Auto-Hold Report'
AttachWindow = ''
AttachKey = ''
SendToGroup = 'AUTO_HOLD'
Message = 'The following makeup cassettes are older than three years and have been automatically '
Message := 'placed on hold.':CRLF$:'Reminder: EpiPro lots can contain multiple RDS lots.':CRLF$:CRLF$
Swap @FM with CRLF$ in NotifyList
Message := NotifyList
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
end
LogData = '' LogData = ''
LogData<1> = OConv(Datetime(), 'DT2/^H') LogData<1> = OConv(Datetime(), 'DT2/^H')
LogData<2> = 'End ':Service LogData<2> = 'End ':Service
@ -1461,3 +1590,4 @@ ClearCursors:
return return

View File

@ -23,4 +23,5 @@ Equ MAKEUP_WAFERS.CURR_STATUS_STATIC$ To 12
Equ MAKEUP_WAFERS.UNLOAD_DTM$ To 13 Equ MAKEUP_WAFERS.UNLOAD_DTM$ To 13
Equ MAKEUP_WAFERS.WFR_QTY$ To 14 Equ MAKEUP_WAFERS.WFR_QTY$ To 14
Equ MAKEUP_WAFERS.EXPIRED$ To 15 Equ MAKEUP_WAFERS.EXPIRED$ To 15
Equ MAKEUP_WAFERS.EXPIRY_LAST_NOTIFY_DTM$ To 16