Migrate BaggerIdentification project.

This commit is contained in:
Infineon\Mitchem
2024-09-12 12:15:48 -07:00
committed by Mitchem Dakota (IT FI MES External)
parent dc8665d553
commit d7215cfa9a
5 changed files with 303 additions and 93 deletions

View File

@ -36,7 +36,7 @@ $insert NOTIFICATION_EQU
Declare function Scan_Services, Memory_Services, Database_Services, SRP_JSON, RTI_CreateGUID, Memberof
Declare function Get_Property, RDS_Services, EpiPro_Services, DateTime, Signature_Services
Declare subroutine Scan_Services, Memory_Services, Database_Services, SRP_JSON, Security_Services, obj_Notes
Declare subroutine obj_WO_Mat_Log, obj_WO_Mat, Set_Status, SAP_Services, Hold_Services
Declare subroutine obj_WO_Mat_Log, obj_WO_Mat, Set_Status, SAP_Services, Rds_Services, Wm_Out_Services
//TODO - flag used during cutover, delete from APP_INFO and removed commented lines reference Use2DBarcode
*Use2DBarcode = Database_Services('ReadDataRow', 'APP_INFO', 'USE_PACKAGING_2D')
@ -56,25 +56,28 @@ Options SCAN_TYPES = 'EMPLOYEE', 'CASSETTE_1', 'CASSETTE_2', 'POLY', 'TRI
// SERVICES
//-----------------------------------------------------------------------------
Service CompletePackaging(CassetteID, OperatorID)
Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
* 1. Write success packaging record in Material Log
* 2. Write success PTO record in Material Log
* 3. Send SAP Cassette Complete transaction (up to now, this has been done at FQA)
* 4. Create comment in CassetteID record
RDSKey = CassetteID
WMOKey = CassetteID
RDSKey = CassetteID
WMOKey = CassetteID
Convert '.' to '*' in WMOKey
CommentEntity = ''
Begin Case
Case RowExists('RDS', RDSKey) EQ True$
// RDS number
WOMatKey = Xlate('RDS', RDSKey, 'WO', 'X')
WOMatKey = WoMatKey:'*':Xlate('RDS', RDSKey, 'CASS_NO', 'X')
WOMatKey = Xlate('RDS', RDSKey, 'WO', 'X')
WOMatKey = WoMatKey:'*':Xlate('RDS', RDSKey, 'CASS_NO', 'X')
CommentEntity = 'RDS'
Case RowExists('WM_OUT', WMOKey) EQ True$
// WM_OUT key
WOMatKey = Xlate('WM_OUT', WMOKey, 'WO_MAT_KEY', 'X')
WOMatKey = Xlate('WM_OUT', WMOKey, 'WO_MAT_KEY', 'X')
CommentEntity = 'WM_OUT'
Case RowExists('WO_MAT', CassetteID) EQ True$
// WO_MAT key
@ -88,6 +91,15 @@ Service CompletePackaging(CassetteID, OperatorID)
If Error_Services('NoError') then
Begin Case
Case BaggerIdentifier EQ 'L'
BaggerIdentifier = 'LeftBagger'
Case BaggerIdentifier EQ 'R'
BaggerIdentifier = 'RightBagger'
Case Otherwise$
BaggerIdentifier = ''
End Case
WONo = Field(WOMatKey, '*', 1, 1)
CassNo = Field(WOMatKey, '*', 2, 1)
@ -105,7 +117,7 @@ Service CompletePackaging(CassetteID, OperatorID)
LocCd = 'PACK'
UserID = OperatorID
Tag = 'Packaging complete'
ToolID = ''
ToolID = BaggerIdentifier
WOMLParms = LogFile:@RM
WOMLParms := LogDTM:@RM
@ -136,6 +148,14 @@ Service CompletePackaging(CassetteID, OperatorID)
// Add CassComp transaction to SAP queue
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
If SAPBatchNo EQ '' then SAP_Services('AddCassCompTransaction', WOMatKey)
Begin Case
Case CommentEntity = 'RDS'
CommentText = 'Packaging completed for RDS ' :CassetteID: ' by user ' : OperatorID
Rds_Services('AddComment', CassetteID, CommentText, OperatorID)
Case CommentEntity = 'WM_OUT'
CommentText = 'Packaging completed for WM_OUT ' :CassetteID: ' by user ' : OperatorID
Wm_Out_Services('AddComment', CassetteID, CommentText, OperatorID)
End Case
end
end
@ -235,8 +255,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
CtrlEntID = False$ ;* Control checked/unchecked
OriginFlag = 'P' ;* Flag to indicate a hold initiated from the packagaing form
Parms = WOMatKey:@RM:HoldEntity:@RM:HoldEntityID:@RM:CtrlEntID:@RM:OriginFlag:@RM:OperatorID
//obj_WO_Mat('ToggleHold', Parms)
Hold_Services('ToggleHold', WOMatKey, HoldEntity, HoldEntityID, CtrlEntID, OriginFlag, '', OperatorID)
obj_WO_Mat('ToggleHold', Parms)
// Write fail packaging record in material log for first cassette ID
LogDate = OCONV( Date(), 'D2/' )
@ -296,7 +315,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
IF Get_Status(errCode) THEN Error_Services('Add', 'Error code ':errCode:' in ':Service:' service.')
// Add error to error stack
ErrorMessage = 'Lots do not match - operation cannot continue. '|
ErrorMessage = 'Lots do not match – operation cannot continue. '|
: 'Lot has been put on hold - place lot on hold shelf and notify Supervisor, Lead, or Engineering'
Error_Services('Add', ErrorMessage)
end
@ -325,11 +344,11 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
end
Case ScanType EQ 'POLY'
If ScanData[1, 5] EQ '1POLY' AND LEN(ScanData) EQ 5 then
If ScanData[1, 5] EQ '1POLY' AND LEN(ScanData) EQ 6 And (ScanData[6,1] EQ 'L' OR ScanData[6,1] EQ 'R') then
// Valid Poly scan - has to be exact match
Response = ScanData[2, 999]
end else
Error_Services('Add', 'Location does not equal POLY - operation cannot continue.')
Error_Services('Add', 'Location does not equal POLY – operation cannot continue.')
end
Case ScanType EQ 'TRILAM'
@ -337,7 +356,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
// Valid Trilam scan - has to be exact match
Response = ScanData[2, 999]
end else
Error_Services('Add', 'Location does not equal TRILAM - operation cannot continue.')
Error_Services('Add', 'Location does not equal TRILAM – operation cannot continue.')
end
Case ScanType EQ 'CASSETTE_1'
@ -388,7 +407,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
HoldStatus = Xlate('WO_MAT', CassetteID, 'HOLD', 'X')
FQAComp = Signature_Services('FinalSigComp', CassetteID)
If (HoldStatus EQ True$) then
ErrorMessage = 'Lot is currently on hold - operation cannot continue. ' |
ErrorMessage = 'Lot is currently on hold – operation cannot continue. ' |
: 'Place lot on hold shelf and notify Supervisor, Lead, or Engineering.'
Error_Services('Add', ErrorMessage)
end else If FQAComp NE True$ then
@ -411,7 +430,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
FQAComp = Epipro_Services('GetFinalQAStatus', CassetteID)
LblCheckComp = Signature_Services('CheckQALabelStatus', WOMatKey)
If (HoldStatus EQ True$) then
ErrorMessage = 'Lot is currently on hold - operation cannot continue. ' |
ErrorMessage = 'Lot is currently on hold – operation cannot continue. ' |
: 'Place lot on hold shelf and notify Supervisor, Lead, or Engineering.'
Error_Services('Add', ErrorMessage)
end else If FQAComp NE True$ then
@ -435,7 +454,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
WONo = Field(WOMatKey, '*', 1)
CassNo = Field(WOMatKey, '*', 2)
If (HoldStatus EQ True$) then
ErrorMessage = 'Lot is currently on hold - operation cannot continue.' |
ErrorMessage = 'Lot is currently on hold – operation cannot continue.' |
: 'Place lot on hold shelf and notify Supervisor, Lead, or Engineering.'
Error_Services('Add', ErrorMessage)
end else If FQAComp NE True$ then
@ -569,8 +588,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
CtrlEntID = False$ ;* Control checked/unchecked
OriginFlag = 'P' ;* Flag to indicate a hold initiated from the packagaing form
Parms = WOMatKey:@RM:HoldEntity:@RM:HoldEntityID:@RM:CtrlEntID:@RM:OriginFlag:@RM:OperatorID
* obj_WO_Mat('ToggleHold', Parms)
Hold_Services('ToggleHold', WOMatKey, HoldEntity, HoldEntityID, CtrlEntID, OriginFlag, '', OperatorID)
obj_WO_Mat('ToggleHold', Parms)
// Check if second cassette ID is a valid RDS or WM_OUT key
Convert '.' to '*' in SecondCassID
@ -628,8 +646,7 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
CtrlEntID = False$ ;* Control checked/unchecked
OriginFlag = 'P' ;* Flag to indicate a hold initiated from the packagaing form
Parms = WOMatKey:@RM:HoldEntity:@RM:HoldEntityID:@RM:CtrlEntID:@RM:OriginFlag:@RM:OperatorID
//obj_WO_Mat('ToggleHold', Parms)
Hold_Services('ToggleHold', WOMatKey, HoldEntity, HoldEntityID, CtrlEntID, OriginFlag, '', OperatorID)
obj_WO_Mat('ToggleHold', Parms)
end
// Send scan mismatch notification