replaced supplement RList calls with Btree.Extract

This commit is contained in:
Infineon\StieberD 2024-09-16 15:17:40 -07:00 committed by Stieber Daniel (IT FI MES)
parent 6fbc512eac
commit 293d01a2c0
6 changed files with 3993 additions and 1895 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -22313,10 +22313,10 @@
"<2>": {
"<2,1>": {
"<2,1,1>": {
"<2,1,1,1>": "SEND_MESSAGE.MESSAGE_W/ATTACHMENT",
"<2,1,1,2>": "PRINT.CUSTOMER_RDS",
"<2,1,1,3>": "PRINT.FACTORY_LABELS",
"<2,1,1,4>": "UNLOAD/LOAD_EXTRA.SIGNATURE_INFO"
"<2,1,1,1>": "UNLOAD/LOAD_EXTRA.SIGNATURE_INFO",
"<2,1,1,2>": "PRINT.FACTORY_LABELS",
"<2,1,1,3>": "PRINT.CUSTOMER_RDS",
"<2,1,1,4>": "SEND_MESSAGE.MESSAGE_W/ATTACHMENT"
}
},
"<2,2>": {

View File

@ -49,15 +49,15 @@ Subclass = SubclassInfo<1>
// Update the arguments so that the OpenInsight OLE event will treate the ActiveX event as a native event handler.
If Event EQ 'OLE' then
Transfer Event to OIEvent
Transfer Param1 to Event
Transfer Param2 to Param1
Transfer Param3 to Param2
* Transfer Param4 to Param3
* Transfer Param5 to Param4
* Transfer Param6 to Param5
* Transfer Param7 to Param6
* Transfer Param8 to Param7
Transfer Event to OIEvent
Transfer Param1 to Event
Transfer Param2 to Param1
Transfer Param3 to Param2
Transfer Param4 to Param3
Transfer Param5 to Param4
Transfer Param6 to Param5
Transfer Param7 to Param6
Transfer Param8 to Param7
end
GoToEvent Event for CtrlEntID
@ -71,67 +71,69 @@ Return EventFlow else EVENT_CONTINUE$
Event WINDOW.CREATE(CreateParam)
Result = ''
SupplInst = ''
GoSub Setup_OLE_Controls
If CreateParam NE '' then
Gosub PopulateStages
Set_Property(@Window : '.CMB_STAGE', 'LIST', StageList)
Set_Property(@Window : '.CMB_STAGE', 'SELPOS', 1)
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
end
Result = ''
SupplInst = ''
GoSub Setup_OLE_Controls
If CreateParam NE '' then
Gosub PopulateStages
Set_Property(@Window : '.CMB_STAGE', 'LIST', StageList)
Set_Property(@Window : '.CMB_STAGE', 'SELPOS', 1)
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
end
Gosub CheckForSupplements
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
Gosub CheckForSupplements
SRP_Show_Window(@Window, '', 'C', 'C', 1, '', False$, False$, FormSize)
end event
Event WINDOW.CLOSE(CancelFlag)
Result = ''
Result<1> = False$
End_Dialog(@Window, Result)
Result = ''
Result<1> = False$
End_Dialog(@Window, Result)
end event
Event CMB_STAGE.CHANGED(CreateParam)
Gosub CheckForSupplements
end event
Event EDL_SUPPL_INST.CHAR(VirtCode, ScanCode, CtrlKey, ShiftKey, AltKey)
SupplInst = Get_Property(CtrlEntId, 'TEXT')
If SupplInst NE '' then
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
end else
Set_Property(@Window : '.PUB_OK', 'ENABLED', False$)
end
SupplInst = Get_Property(CtrlEntId, 'TEXT')
If SupplInst NE '' then
Set_Property(@Window : '.PUB_OK', 'ENABLED', True$)
end else
Set_Property(@Window : '.PUB_OK', 'ENABLED', False$)
end
end event
Event PUB_OK.CLICK()
Result = ''
SupplInst = Get_Property(@Window : '.EDL_SUPPL_INST', 'TEXT')
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
StageReturn = Field(StageSel, '-', 2)
Result = ''
SupplInst = Get_Property(@Window : '.EDL_SUPPL_INST', 'TEXT')
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
StageReturn = Field(StageSel, '-', 2)
Result<1> = True$
Result<2> = StageReturn :': ': SupplInst
End_Dialog(@Window, Result)
Result<1> = True$
Result<2> = StageReturn :': ': SupplInst
End_Dialog(@Window, Result)
end event
Event PUB_CANCEL.CLICK()
Result = ''
Result<1> = False$
End_Dialog(@Window, Result)
Result = ''
Result<1> = False$
End_Dialog(@Window, Result)
end event
@ -142,9 +144,9 @@ end event
Setup_OLE_Controls:
Qualify = ''
Qualify<1> = 1
Qualify<4> = 0
Qualify = ''
Qualify<1> = 1
Qualify<4> = 0
return
@ -155,7 +157,6 @@ PopulateStages:
RDSList = SRP_Array("Rotate", CreateParam)
@ReCur1 = RDSList<5>
@ReCur2 = RDSList<15>
For Each RDSKey in @ReCur1 Using @VM
RDSStageList = Supplement_Services('GetStagesForLot', 'RDS', RDSKey)
RDSStageList2 = RDSStageList<2> :@FM: RDSStageList<1>
@ -168,14 +169,16 @@ PopulateStages:
Next RDSKey
Swap @VM with ' -' in DraftStageList
StageList = SRP_Array('Clean', DraftStageList, "TrimAndMakeUnique", @FM)
return
CheckForSupplements:
SuppFound = False$
SuppText = ''
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
Stage = Field(StageSel, '-', 2)
SuppFound = False$
SuppText = ''
StageSel = Get_Property(@Window : '.CMB_STAGE', 'TEXT')
Stage = Field(StageSel, '-', 2)
For Each RDSKey in @ReCur1 Using @VM Setting Pos
If @Recur2<pos> NE '' then
Supps = @Recur2<pos>
@ -186,7 +189,7 @@ CheckForSupplements:
SuppText = TrimF(SuppText)
SuppFound = True$
end
Until SuppFound NE False$
Until SuppFound NE False$
Next Supp
If SuppText EQ '' then SuppFound = Supplement_Services('GetSupplementsForLot', 'RDS', RDSKey, Stage)
end else
@ -212,8 +215,3 @@ CheckForSupplements:
return

View File

@ -46,6 +46,7 @@ Compile function Supplement_Services(@Service, @Params)
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
$insert APP_INSERTS
$Insert SERVICE_SETUP
$Insert SUPPLEMENTS_EQUATES
@ -54,7 +55,8 @@ Equ COMMA$ to ','
Declare function Database_Services, Supplement_Services, Rti_Createguid, SRP_Array, Datetime, Signature_Services
Declare function Environment_Services, Logging_Services, Select_Into
Declare subroutine Database_Services, RList, Rds_Services, Supplement_Services, Logging_Services, Set_Status, SRP_Stopwatch
Declare subroutine Database_Services, Rds_Services, Supplement_Services, Logging_Services, Set_Status, SRP_Stopwatch
Declare subroutine Btree.Extract
GoToService else
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.')
@ -71,9 +73,9 @@ Options LOTTYPES = 'RDS', 'WO_MAT'
Options STAGES = 'VER', 'PREC','PREI', 'PRES', 'LOAD', 'FWII', 'FWIS', 'UNLOAD', 'LWII', 'LWIS', 'PSTC', 'PSTI', 'PSTS', 'QA', 'POST'
//-----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SERVICES
//-----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------------------------------------------------------------------
@ -152,39 +154,38 @@ End Service
//----------------------------------------------------------------------------------------------------------------------
Service GetStagesWithSupplements(LotType=LOTTYPES, LotID)
If LotType NE '' and LotID NE '' then
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID)
ClearSelect
Rlist(Statement, 5, '', '', '')
If @RecCount NE 0 and @List_Active EQ 3 then
StageList = ''
Cursor = ''
Done = 0
Open 'SUPPLEMENTS' To FileVar then
Loop
ReadNext Key Using Cursor Else Done = True$
Until Done do
Read SuppRec from FileVar, Key then
StageList<-1> = SuppRec<SUPPLEMENTS_STAGE$>
end
Repeat
End
If StageList NE '' then
Response = StageList
end else
Response = False$
end
end else
Set_Status(0)
Response = FALSE$
end
StageList = ''
Response = False$
If ( (LotType NE '') and (LotID NE '') ) then
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
Open 'SUPPLEMENTS' to hTable then
For each Key in KeyList using @VM setting vPos
Read SuppRec from hTable, Key then StageList<-1> = SuppRec<SUPPLEMENTS_STAGE$>
Next Key
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS table.')
end
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
Response = FALSE$
Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
end
If StageList NE '' then Response = StageList
end service
@ -198,20 +199,36 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service GetLotsWithSupplements(LotType)
ClearSelect
Statement = 'LIST SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' BY LOT_ID LOT_ID'
Lots = Select_Into(Statement, 'EDT')
If Lots NE '' then
FlipLots = SRP_Array('Rotate',Lots)
Lots = FlipLots<2>
Response = SRP_Array('Clean', Lots, "TrimAndMakeUnique", @VM)
KeyList = ''
LotList = ''
Response = False$
If (LotType NE '') then
KeyList = ''
Query = 'LOT_TYPE' : @VM : LotType : @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
LotList = Xlate('SUPPLEMENTS', KeyList, 'LOT_ID', 'X')
LotList = SRP_Array('Clean', LotList, 'TrimAndMakeUnique', @VM)
LotList = SRP_Array("SortSimpleList", LotList, 'AscendingNumbers', @VM)
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
Response = FALSE$
Set_Status(0)
Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
end
If LotList NE '' then Response = LotList
end service
//----------------------------------------------------------------------------------------------------------------------
// GetSupplementsForLot
//
@ -224,58 +241,52 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service GetSupplementsForLot(LotType=LOTTYPES, LotID, Stage=STAGES)
If LotType NE '' and LotID NE '' then
If Stage EQ '' then
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID)
ClearSelect
Rlist(Statement, 5, '', '', '')
If @RecCount NE 0 and @List_Active EQ 3 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 else
Response = False$
end
end else
Set_Status(0)
Response = FALSE$
end
Response = False$
If ( (LotType NE '') and (LotID NE '') ) then
If (Stage EQ '') then
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 = ''
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID)
Statement2 = 'SELECT SUPPLEMENTS WITH STAGE EQ ' :Quote(Stage)
ClearSelect
Rlist(Statement, 5, '', '', '')
Rlist(Statement2, 5, '', '', '')
If @RecCount NE 0 and @List_Active EQ 3 then
Cursor = ''
Done = 0
Open 'SUPPLEMENTS' To FileVar then
Loop
ReadNext Key Using Cursor Else Done = True$
Until Done
StageSupplementList<-1> = Key
Repeat
End
If StageSupplementList NE '' then
Response = StageSupplementList
end else
Response = False$
end
Query = ''
Query<1> = 'LOT_TYPE' : @VM : LotType
Query<2> = 'LOT_ID' : @VM : LotID
Query<3> = 'STAGE' : @VM : Stage : @FM
Flag = ''
Open 'DICT.SUPPLEMENTS' to hDict then
Btree.Extract(Query, 'SUPPLEMENTS', hDict, StageSupplementList, 'E', Flag)
If (Flag EQ 0) then
If StageSupplementList NE '' then Response = StageSupplementList
end else
Error_Services('Add', 'Error in ':Service:' service. Error calling Btree.Extract')
end
end else
Set_Status(0)
Response = FALSE$
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS dictionary.')
end
end
end
end else
Response = FALSE$
Error_Services('Add', 'LotType or LotID was missing in the ' : Service : ' service.')
end
@ -294,32 +305,31 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service UpdateSupplementText(SupplID, NewText, EntryUser)
If SupplID NE '' And NewText NE '' then
Response = False$
If ( (SupplID NE '') and (NewText NE '') ) then
OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '')
If OldRec NE '' then
NewRec = OldRec
NewRec<SUPPLEMENTS_SUPPL_TEXT$> = NewText
NewRec<SUPPLEMENTS_ENTRY_USER$> = EntryUser
NewRec = OldRec
NewRec<SUPPLEMENTS_SUPPL_TEXT$> = NewText
NewRec<SUPPLEMENTS_ENTRY_USER$> = EntryUser
NewRec<SUPPLEMENTS_ENTRY_DATETIME$> = Datetime()
Database_Services('WriteDataRow', 'SUPPLEMENTS', SupplID, NewRec, True$, False$, False$)
If Error_Services('NoError') then
Response = SupplID
Supplement_Services('LogSupplementChange', OldRec, 'Edited', EntryUser)
end else
Response = FALSE$
Error_Services('Add', 'Error editing Supplement record.')
end
end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.')
end
end else
Response = FALSE$
Error_Services('Add', 'SupplID or NewText was missing in the ' : Service : ' service.')
end
end service
//----------------------------------------------------------------------------------------------------------------------
// DeleteSupplementByByLotStage
//
@ -333,7 +343,8 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service DeleteSupplementByLotStage(EntryUser, LotType=LOTTYPES, LotID, Stage=STAGES)
If LotType NE '' and LotID NE '' and Stage NE '' and EntryUser NE '' then
Response = False$
If ( (LotType NE '') and (LotID NE '') and (Stage NE '') and (EntryUser NE '') ) then
ExistingSupps = Supplement_Services('GetSupplementsForLot', LotType, LotID, Stage)
If ExistingSupps NE '' then
For Each SupplID in ExistingSupps using @VM
@ -343,16 +354,13 @@ Service DeleteSupplementByLotStage(EntryUser, LotType=LOTTYPES, LotID, Stage=STA
Supplement_Services('LogSupplementChange', SupplRec, 'Deleted', EntryUser)
Response = TRUE$
end else
Response = FALSE$
Error_Services('Add', 'Error deleting Supplement record.')
end
Next SupplID
end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.')
end
end else
Response = FALSE$
Error_Services('Add', 'SupplID was missing in the ' : Service : ' service.')
end
@ -370,23 +378,20 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service DeleteSupplementByID(SupplID, EntryUser)
Response = False$
If SupplID NE '' then
TestRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '')
If TestRec NE '' then
If RowExists('SUPPLEMENTS', SupplID) then
Database_Services('DeleteDataRow', 'SUPPLEMENTS', SupplID, True$, False$)
If Error_Services('NoError') then
Supplement_Services('LogSupplementChange', TestRec, 'Deleted', EntryUser)
Response = TRUE$
end else
Response = FALSE$
Error_Services('Add', 'Error deleting Supplement record.')
end
end else
Response = FALSE$
Error_Services('Add', 'Record does not exist.')
end
end else
Response = FALSE$
Error_Services('Add', 'SupplID was missing in the ' : Service : ' service.')
end
@ -404,7 +409,7 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service GetStagesForLot(LotType=LOTTYPES, LotID)
If LotType NE '' AND LotID NE '' then
If ( (LotType NE '') and (LotID NE '') ) then
Stages = ''
Begin Case
Case LotType EQ 'WO_MAT'
@ -434,7 +439,7 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service TranslateStages(ValidStages)
If ValidStages NE '' And ValidStages NE False$ And Error_Services('NoError') then
If ( (ValidStages NE '') and (ValidStages NE False$) and ( Error_Services('NoError') ) ) then
ValidStageArray = ''
ValidStageArray<1> = ValidStages
AllStages = XLATE('SYSREPOSPOPUPS','LSL2**SIG_PROF_KEYS',8,'X')
@ -468,7 +473,7 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service AcknowledgeSupplement(SupplID, EntryUser)
If SupplID NE '' And EntryUser NE '' then
If ( (SupplID NE '') and (EntryUser NE '') ) then
OldRec = Xlate('SUPPLEMENTS', SupplID, '', 'X', '')
If OldRec NE '' then
NewRec = OldRec
@ -507,37 +512,40 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service UnacknowledgedSupplementCheck(LotType=LOTTYPES, LotID, Stage=STAGES)
If LotType NE '' and LotID NE '' and Stage NE '' then
Response = ''
Statement = 'SELECT SUPPLEMENTS WITH LOT_TYPE EQ ' :Quote(LotType): ' AND WITH LOT_ID EQ ' :Quote(LotID)
Statement2 = 'SELECT SUPPLEMENTS WITH STAGE EQ ' :Quote(Stage)
ClearSelect
Rlist(Statement, 5, '', '', '')
Rlist(Statement2, 5, '', '', '')
If @RecCount NE 0 and @List_Active EQ 3 then
Unacknowledged = False$
Cursor = ''
Done = 0
Open 'SUPPLEMENTS' To FileVar then
Loop
ReadNext Key Using Cursor Else Done = True$
Until Done
AckField = Xlate('SUPPLEMENTS', Key, 'SUPPL_ACK', 'X', '')
If AckField NE True$ then Unacknowledged = True$
If Unacknowledged EQ True$ then Response<-1> = Key
Repeat
If Response EQ '' then Response = FALSE$
End
end else
Response = FALSE$
Set_Status(0)
end
UnackList = ''
Response = False$
If ( (LotType NE '') and (LotID NE '') and (Stage NE '') ) then
KeyList = ''
Query = ''
Query<1> = 'LOT_TYPE' : @VM : LotType
Query<2> = 'LOT_ID' : @VM : LotID
Query<3> = 'STAGE' : @VM : Stage : @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
Open 'SUPPLEMENTS' to hTable then
For each Key in KeyList using @VM setting vPos
AckField = Xlate('SUPPLEMENTS', Key, 'SUPPL_ACK', 'X', '')
If AckField NE True$ then UnackList<-1> = Key
Next Key
end else
Error_Services('Add', 'Error in ':Service:' service. Error opening SUPPLEMENTS table.')
end
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
Response = FALSE$
Error_Services('Add', 'LotType, LotID, or Stage was missing in the ' : Service : ' service.')
end
If UnackList NE '' then Response = UnackList
end service
@ -553,7 +561,7 @@ end service
//----------------------------------------------------------------------------------------------------------------------
Service LogSupplementChange(SupplementRec, EditEvent, EntryUser)
If SupplementRec NE '' and EditEvent NE '' and EntryUser NE '' then
If ( (SupplementRec NE '') and (EditEvent NE '') and (EntryUser NE '') ) then
SupplementText = SupplementRec<SUPPLEMENTS_SUPPL_TEXT$>
LotType = SupplementRec<SUPPLEMENTS_LOT_TYPE$>
LotID = SupplementRec<SUPPLEMENTS_LOT_ID$>
@ -595,7 +603,3 @@ Service FileLogSuccessfulSupp(LogText, EntryUser, EditEvent)
end service