Restored obj_RDS('MetPropFlag') to previous version for performance reasons. Refactored Supplement_Services to improve performance.

This commit is contained in:
Infineon\StieberD
2025-08-14 13:15:21 -07:00
parent e1c7544fac
commit 494988d394
4 changed files with 71 additions and 88 deletions

View File

@ -677,6 +677,3 @@ CheckSelectedForHolds:
return return

View File

@ -1169,10 +1169,13 @@ MetPropFlag:
IF RDSRec = '' THEN RETURN IF RDSRec = '' THEN RETURN
WONo = RDSRec<RDS_WO$> WONo = RDSRec<RDS_WO$>
WOStepKey = RDSRec<RDS_WO_STEP_KEY$>
ReactNo = RDSRec<RDS_REACTOR$> ReactNo = RDSRec<RDS_REACTOR$>
PSNo = RDSRec<RDS_PROD_SPEC_ID$> PSNo = RDSRec<RDS_PROD_SPEC_ID$>
ReactRDSNos = Rds_Services('GetRDSRunHistoryByReactorAndWO', ReactNo, WONo) WOStepNo = FIELD(WOStepKey,'*',2)
ReactRDSNos = XLATE('WO_REACT',WONo:'*':WOStepNo:'*':ReactNo,WO_REACT_RDS_NO$,'X')
LOCATE RDSNo IN ReactRDSNos USING @VM SETTING Pos THEN LOCATE RDSNo IN ReactRDSNos USING @VM SETTING Pos THEN
Result = obj_PRS_Prop('GetIntervalFlag',PSNo:@RM:PropCd:@RM:Pos) Result = obj_PRS_Prop('GetIntervalFlag',PSNo:@RM:PropCd:@RM:Pos)
@ -1239,4 +1242,3 @@ CalcThickTarget:
RETURN RETURN

View File

@ -128,6 +128,12 @@ Service CreateSupplement(LotType=LOTTYPES, LotID, Stage=STAGES, SupplText, Entry
NewSupRec<SUPPLEMENTS_SUPPL_TEXT$> = SupplText NewSupRec<SUPPLEMENTS_SUPPL_TEXT$> = SupplText
NewSupRec<SUPPLEMENTS_ENTRY_USER$> = EntryUser NewSupRec<SUPPLEMENTS_ENTRY_USER$> = EntryUser
NewSupRec<SUPPLEMENTS_ENTRY_DATETIME$> = Datetime() NewSupRec<SUPPLEMENTS_ENTRY_DATETIME$> = Datetime()
If Stages NE False$ then
StageList = Stages<1>
Locate Stage in StageList using @VM setting StageIndex then
NewSupRec<SUPPLEMENTS_STAGE_INDEX$> = StageIndex
end
end
Database_Services('WriteDataRow', 'SUPPLEMENTS', SupplID, NewSupRec, True$, False$, False$) Database_Services('WriteDataRow', 'SUPPLEMENTS', SupplID, NewSupRec, True$, False$, False$)
If Error_Services('NoError') then If Error_Services('NoError') then
Response = SupplID Response = SupplID
@ -305,32 +311,7 @@ Service GetSupplementsForLot(LotType=LOTTYPES, LotID, Stage=STAGES)
Response = False$ Response = False$
If ( (LotType NE '') and (LotID NE '') ) then If ( (LotType NE '') and (LotID NE '') ) then
If (Stage EQ '') then If Stage EQ '' then Stage = '#0'
KeyList = ''
Query = ''
Query<1> = 'LOT_TYPE' : @VM : LotType
Query<2> = 'LOT_ID' : @VM : LotID : @FM
Flag = ''
Open 'DICT.SUPPLEMENTS' to hDict then
Btree.Extract(Query, 'SUPPLEMENTS', hDict, KeyList, 'E', Flag)
If (Flag EQ 0) then
If (KeyList NE '') then
SupplementList = ''
Stages = Supplement_Services('GetStagesForLot', LotType, LotID)
StageCount = Dcount(Stages<1>, @VM)
For I = 1 to StageCount
SupplementStage = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stages<1,I>)
If SupplementStage NE False$ then SupplementList<-1> = SupplementStage
Next I
If SupplementList NE '' then Response = SupplementList
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
end
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
end
end else
StageSupplementList = '' StageSupplementList = ''
Query = '' Query = ''
Query<1> = 'LOT_TYPE' : @VM : LotType Query<1> = 'LOT_TYPE' : @VM : LotType
@ -340,14 +321,20 @@ Service GetSupplementsForLot(LotType=LOTTYPES, LotID, Stage=STAGES)
Open 'DICT.SUPPLEMENTS' to hDict then Open 'DICT.SUPPLEMENTS' to hDict then
Btree.Extract(Query, 'SUPPLEMENTS', hDict, StageSupplementList, 'E', Flag) Btree.Extract(Query, 'SUPPLEMENTS', hDict, StageSupplementList, 'E', Flag)
If (Flag EQ 0) then If (Flag EQ 0) then
If StageSupplementList NE '' then Response = StageSupplementList If StageSupplementList NE '' then
StageIndexes = Xlate('SUPPLEMENTS', StageSupplementList, 'STAGE_INDEX', 'X')
SortArray = StageIndexes:@FM:StageSupplementList
SortArray = SRP_Array('SortRows', SortArray, 'AR1', 'ARRAY', @FM, @VM)
SortedStageSupplementList = SortArray<2>
Convert @VM to @FM in SortedStageSupplementList
Response = SortedStageSupplementList
end
end else end else
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract') Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
end end
end else end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.') Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
end end
end
end else end else
Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.') Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
end end
@ -683,6 +670,3 @@ Service SendNotifications(RDSList, EditEvent, Instructions, EntryUser)
end service end service

View File

@ -16,5 +16,5 @@ Equ SUPPLEMENTS_ACK_USER$ To 6
Equ SUPPLEMENTS_ACK_DTM$ To 7 Equ SUPPLEMENTS_ACK_DTM$ To 7
Equ SUPPLEMENTS_ENTRY_USER$ To 8 Equ SUPPLEMENTS_ENTRY_USER$ To 8
Equ SUPPLEMENTS_ENTRY_DATETIME$ To 9 Equ SUPPLEMENTS_ENTRY_DATETIME$ To 9
Equ SUPPLEMENTS_STAGE_INDEX$ To 10