cache TW Lot JSON unless changed

This commit is contained in:
Chase Tucker
2025-07-08 17:33:20 -07:00
parent d4ce96337b
commit 269e5f9bd4
2 changed files with 82 additions and 51 deletions

View File

@ -301,6 +301,7 @@ Service ProcessScanData(ScanID, ScanJSON)
Locate LotId in TWLots using @VM setting twPos then
Error_Services('Add', LotID : ' has already been added as a test wafer lot being used.')
end else
ScansRow<SCANS.TW_LOT_CHANGED$> = True$
LotCurrentOperation = Lot_Services('GetLotCurrOperationName', LotId)
If LotCurrentOperation NE 'TW_CREATE' AND LotCurrentOperation NE 'TW_CLOSE' then
LotCurrWfrQty = Database_Services('ReadDataColumn', 'LOT', LotId, LOT_WAFER_QTY$, True$, 0, False$)
@ -573,6 +574,7 @@ Service ProcessScanData(ScanID, ScanJSON)
Locate TWLot in ThisScanTWLots using @VM setting twPOS then
ScansRow<SCANS.TW_LOT_QTY$, twPos> = TWLotQuantity
ScansRow<SCANS.TW_LOT_CHANGED$> = True$
end
Case ScanData[1, 17] EQ 'TESTRUNTYPEUPDATE'
@ -684,9 +686,10 @@ Service ProcessScanData(ScanID, ScanJSON)
// "RDS" process.
If (CassetteIDs NE '') then
TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$>
TestWaferLotChanged = ScansRow<SCANS.TW_LOT_CHANGED$>
Abort = False$
TestWaferLotIsValid = False$
If TestWaferLotData NE '' then
If TestWaferLotData NE '' and TestWaferLotChanged NE False$ then
ThisTestRunType = ScansRow<SCANS.TEST_RUN_TYPE_ID$>
If ThisTestRunType NE '' then
for each TWLot in TestWaferLotData using @VM setting twPOS
@ -1218,47 +1221,50 @@ Service ProcessScanData(ScanID, ScanJSON)
end else
If ScansRow<SCANS.TW_LOT_ID$> NE '' then
TestWaferLotChanged = ScansRow<SCANS.TW_LOT_CHANGED$>
ThisTestRunType = ScansRow<SCANS.TEST_RUN_TYPE_ID$>
ThisUser = ScansRow<SCANS.EMPLOYEE_ID$>
If ThisTestRunType NE '' then
If RowExists('LSL_USERS', ThisUser) then
TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$>
Abort = False$
for each TWLot in TestWaferLotData using @VM setting twPOS
If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then
TWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_WAFER_QTY$, True$, 0, False$)
ThisCurrUsageQty = ScansRow<SCANS.TW_LOT_QTY$, twPOS>
If TWLotCurrQty GT 0 then
If TWLotCurrQty GE ThisCurrUsageQty then
TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot)
If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then
TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$)
If Not(TWLotCurrOpen) then
If TestWaferLotChanged NE False$ then
If ThisTestRunType NE '' then
If RowExists('LSL_USERS', ThisUser) then
TestWaferLotData = ScansRow<SCANS.TW_LOT_ID$>
Abort = False$
for each TWLot in TestWaferLotData using @VM setting twPOS
If ScansRow<SCANS.TW_LOT_QTY$, twPOS> NE '' OR ScansRow<SCANS.TW_LOT_QTY$, twPOS> GT 0 then
TWLotCurrQty = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_WAFER_QTY$, True$, 0, False$)
ThisCurrUsageQty = ScansRow<SCANS.TW_LOT_QTY$, twPOS>
If TWLotCurrQty GT 0 then
If TWLotCurrQty GE ThisCurrUsageQty then
TWLotCurrOperation = Lot_Services('GetLotCurrOperationName', TWLot)
If TWLotCurrOperation NE 'TW_CREATE' AND TWLotCurrOperation NE 'TW_CLOSE' then
TWLotCurrOpen = Database_Services('ReadDataColumn', 'LOT', TWLot, LOT_OPEN$, True$, 0, False$)
If Not(TWLotCurrOpen) then
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.')
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is closed and cannot be used at this time.')
end
end else
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.')
end
end else
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' is currently at ':TWLotCurrOperation:' and cannot be used at this time.')
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' does not have enough wafers. Please select ' : TWLotCurrQty : ' wafers or less.')
end
end else
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' does not have enough wafers. Please select ' : TWLotCurrQty : ' wafers or less.')
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' has no wafers and cannot be logged for usage.')
end
end else
Scan_Services('AddNotAcceptableReason', 'Test wafer Lot ':TWLot:' has no wafers and cannot be logged for usage.')
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.')
end
end else
Abort = True$
Scan_Services('AddNotAcceptableReason', 'Lot ':TWLot:' must have a quantity associated with it.')
end
Until Abort
Next TWLot
Until Abort
Next TWLot
end else
Scan_Services('AddNotAcceptableReason', 'A User ID Scan is required to log test wafer usage.')
end
end else
Scan_Services('AddNotAcceptableReason', 'A User ID Scan is required to log test wafer usage.')
Scan_Services('AddNotAcceptableReason', 'A test run type is required to log test wafer usage.')
end
end else
Scan_Services('AddNotAcceptableReason', 'A test run type is required to log test wafer usage.')
end
end else
Scan_Services('AddNotAcceptableReason', 'A cassette must be scanned in order to complete a tool scan.')
@ -1689,6 +1695,8 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
jsonScan = ''
mvScanChanged = False$
If ScanID NE '' then
If mvScan EQ '' then mvScan = Database_Services('ReadDataRow', 'SCANS', ScanID)
@ -1724,17 +1732,39 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
// TestWafer Lot Object.
If SRP_JSON(hTWLotArray, 'New', 'Array') then
Abort = False$
TestWaferLotsChanged = {TW_LOT_CHANGED}
TW_Lot_Json = {TW_LOT_JSON}
ParsingResult = ''
TestWaferLots = {TW_LOT_ID}
for each TestWaferLotId in TestWaferLots using @VM setting twPos
thisTWLotJson = ''
If SRP_JSON(thisTWLotJson, 'New', 'Object') then
SRP_JSON(thisTWLotJson, 'SetValue', 'testWaferLotId', {TW_LOT_ID}<1, twPos>)
SRP_JSON(thisTWLotJson, 'SetValue', 'quantity', {TW_LOT_QTY}<1, twPos>, 'Integer')
SRP_JSON(hTWLotArray, 'Add', thisTWLotJson)
SRP_JSON(thisTWLotJson, 'Release')
If TestWaferLots NE '' then
If TestWaferLotsChanged NE True$ and TW_Lot_Json NE '' then
If TW_Lot_Json NE '' then
ParsingResult = SRP_JSON(TWLotJSON, 'Parse', TW_Lot_JSON)
If ParsingResult EQ '' then
SRP_JSON(objJSONScan, 'Set', 'testWaferLots', TWLotJSON)
end
end
end
Next TestWaferLotId
SRP_JSON(objJSONScan, 'Set', 'testWaferLots', hTWLotArray)
If TW_Lot_Json EQ '' or TestWaferLotsChanged EQ True$ or ParsingResult NE '' then
for each TestWaferLotId in TestWaferLots using @VM setting twPos
thisTWLotJson = ''
If SRP_JSON(thisTWLotJson, 'New', 'Object') then
SRP_JSON(thisTWLotJson, 'SetValue', 'testWaferLotId', {TW_LOT_ID}<1, twPos>)
SRP_JSON(thisTWLotJson, 'SetValue', 'quantity', {TW_LOT_QTY}<1, twPos>, 'Integer')
SRP_JSON(hTWLotArray, 'Add', thisTWLotJson)
SRP_JSON(thisTWLotJson, 'Release')
end
Next TestWaferLotId
TW_Lot_Json = SRP_JSON(hTWLotArray, 'Stringify', 'Fast')
mvScan<SCANS.TW_LOT_JSON$> = TW_Lot_Json
mvScan<SCANS.TW_LOT_CHANGED$> = False$
mvScanChanged = True$
SRP_JSON(objJSONScan, 'Set', 'testWaferLots', hTWLotArray)
end
end
SRP_JSON(hTWLotArray, 'Release')
end
SRP_JSON(objScan, 'SetValue', 'testRunTypeId', {TEST_RUN_TYPE_ID}, 'Integer')
@ -1758,14 +1788,6 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
end
SRP_JSON(hTestRunTypeArray, 'Release')
end
// Created object.
objCreated = ''
If SRP_JSON(objCreated, 'New', 'Object') then
SRP_JSON(objCreated, 'SetValue', 'date', Oconv({CREATED_DATE}, 'D4/'), 'String')
SRP_JSON(objCreated, 'SetValue', 'time', Oconv({CREATED_TIME}, 'MTH'), 'String')
SRP_JSON(objJSONScan, 'Set', 'created', objCreated)
SRP_JSON(objCreated, 'Release')
end
// Employee object
objEmployee = ''
If SRP_JSON(objEmployee, 'New', 'Object') then
@ -2072,6 +2094,10 @@ Service ConvertMVScanToJSON(ScanID, mvScan, itemURL)
jsonScan = SRP_JSON(objJSONScan, 'Stringify', 'Fast')
SRP_JSON(objJSONScan, 'Release')
If mvScanChanged EQ True$ then
Database_Services('WriteDataRow', 'SCANS', {SCAN_ID}, mvScan, True$, False$, False$)
end
end else
Error_Services('Add', 'Unable to create JSON representation in the ' : Service : ' service.')
end
@ -2322,3 +2348,5 @@ return

View File

@ -41,8 +41,11 @@ compile insert SCANS_EQUATES
equ SCANS.TEST_RUN_TYPE_ID$ to 32
equ SCANS.TEST_RUN_TYPE_NAME$ to 33
equ SCANS.IS_AUTHORIZED_TO_OVERRIDE_ROTR$ to 34
equ SCANS.TW_LOT_CHANGED$ to 35
equ SCANS.TW_LOT_JSON$ to 36
#endif