Merged PR 21151: Return To Fab Operations and Processing
This commit is contained in:
parent
b607432be4
commit
aabd4c3a91
@ -32,11 +32,24 @@ $insert SCANS_EQUATES
|
||||
$insert APP_INSERTS
|
||||
$insert WO_MAT_EQUATES
|
||||
$insert NOTIFICATION_EQU
|
||||
$insert PACKAGING_EQUATES
|
||||
$insert LOT_OPERATION_EQUATES
|
||||
$Insert LOT_EQUATES
|
||||
|
||||
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 function Get_Property, RDS_Services, EpiPro_Services, DateTime, Signature_Services, Packaging_Services
|
||||
Declare function Lot_Services, Environment_Services, Logging_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, Rds_Services, Wm_Out_Services, Hold_Services
|
||||
Declare subroutine Lot_Event_Services, Lot_Services, Packaging_Services, Logging_Services
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\Packaging'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Packaging Log.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'Message'
|
||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
|
||||
GoToService else
|
||||
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' module.')
|
||||
@ -62,6 +75,7 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
||||
|
||||
RDSKey = CassetteID
|
||||
WMOKey = CassetteID
|
||||
LotId = ''
|
||||
Convert '.' to '*' in WMOKey
|
||||
CommentEntity = ''
|
||||
Begin Case
|
||||
@ -70,11 +84,13 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
||||
WOMatKey = Xlate('RDS', RDSKey, 'WO', 'X')
|
||||
WOMatKey = WoMatKey:'*':Xlate('RDS', RDSKey, 'CASS_NO', 'X')
|
||||
CommentEntity = 'RDS'
|
||||
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', RDSKey, 'RDS')
|
||||
|
||||
Case RowExists('WM_OUT', WMOKey) EQ True$
|
||||
// WM_OUT key
|
||||
WOMatKey = Xlate('WM_OUT', WMOKey, 'WO_MAT_KEY', 'X')
|
||||
CommentEntity = 'WM_OUT'
|
||||
LotId = Lot_Services('GetLotIdByLegacyLotIdAndType', WMOKey, 'WM_OUT')
|
||||
|
||||
Case RowExists('WO_MAT', CassetteID) EQ True$
|
||||
// WO_MAT key
|
||||
@ -126,7 +142,7 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
||||
WOMLParms := ToolID
|
||||
|
||||
obj_WO_Mat_Log('Create',WOMLParms)
|
||||
errCode = ''
|
||||
errCode = ''
|
||||
IF Get_Status(errCode) THEN
|
||||
swap @SVM with CRLF$ in errCode
|
||||
ErrorMsg = 'Errors calling obj_WO_Mat_Log("Create"). Error code: ':errCode:', Len(errCode)=':Len(errCode)
|
||||
@ -138,6 +154,24 @@ Service CompletePackaging(CassetteID, OperatorID, BaggerIdentifier)
|
||||
// Add CassComp transaction to SAP queue
|
||||
SAPBatchNo = Xlate('WO_MAT', WOMatKey, 'SAP_BATCH_NO', 'X')
|
||||
If SAPBatchNo EQ '' then SAP_Services('AddCassCompTransaction', WOMatKey)
|
||||
|
||||
//Handle NG lot functions.
|
||||
If LotId NE '' then
|
||||
NewPackRecId = Packaging_Services('CreatePackagingRecord', LotId, UserID, ToolID)
|
||||
CurrOperationId = Lot_Services('GetLotCurrOperationId', LotId)
|
||||
If CurrOperationId NE '' then
|
||||
Packaging_Services('AddPackToLotOperation', CurrOperationId, NewPackRecId, UserID)
|
||||
If Error_Services('NoError') then
|
||||
Lot_Services('MoveOutLot', LotId, UserId)
|
||||
end
|
||||
end
|
||||
|
||||
If Error_Services('HasError') then
|
||||
//Remove any error messages as a result of NG Lot functions. At the moment we don't want them interrupting production when they occur.
|
||||
Error_Services('Clear')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@ -664,3 +698,72 @@ Service ProcessScanData(ScanData, ScanType = SCAN_TYPES, Param1, Param2, Param3)
|
||||
|
||||
end service
|
||||
|
||||
Service CreatePackagingRecord(LotId, UserId, EqpId)
|
||||
|
||||
NewRecId = ''
|
||||
ErrorMessage = ''
|
||||
|
||||
If RowExists('LOT', LotId) then
|
||||
NewRecId = RTI_CreateGuid()
|
||||
TransDtm = Datetime()
|
||||
NewPackagingRec = ''
|
||||
NewPackagingRec<PACKAGING_LOT_ID$> = LotId
|
||||
NewPackagingRec<PACKAGING_COMPLETE$> = True$
|
||||
NewPackagingRec<PACKAGING_COMPLETE_DTM$> = TransDtm
|
||||
Database_Services('WriteDataRow', 'PACKAGING', NewRecId, NewPackagingRec, True$, 0, False$)
|
||||
If Error_Services('NoError') then
|
||||
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'PACKAGING', 'Lot Packaged.', EqpId, UserId)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'LOT: ' LotId : ' not found'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
LogData = ''
|
||||
LogData<1> = LoggingDTM
|
||||
LogData<2> = Error_Services('GetMessage')
|
||||
Logging_Services('AppendLog', objLog, LogData, @RM, @FM, False$)
|
||||
Error_Services('Clear')
|
||||
end
|
||||
|
||||
Response = NewRecId
|
||||
|
||||
end service
|
||||
|
||||
Service AddPackToLotOperation(LotOperationId, PackagingId, UserId)
|
||||
|
||||
ErrorMessage = ''
|
||||
|
||||
If RowExists('LOT_OPERATION', LotOperationId) then
|
||||
If RowExists('LSL_USERS', UserId) then
|
||||
//Can add user group check here.
|
||||
LotOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', LotOperationId, True$, 0, False$)
|
||||
LotId = LotOperationRec<LOT_OPERATION_LOT_ID$>
|
||||
ExistingPackId = LotOperationRec<LOT_OPERATION_PACKAGING_ID$>
|
||||
If ExistingPackId EQ '' then
|
||||
LotOperationRec<LOT_OPERATION_PACKAGING_ID$> = PackagingId
|
||||
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationId, LotOperationRec)
|
||||
If Error_Services('NoError') then
|
||||
TransDtm = Datetime()
|
||||
Lot_Event_Services('CreateLotEvent', LotId, TransDtm, 'COMMENT', 'PACKAGING record added to operation.', '', UserId)
|
||||
end else
|
||||
ErrorMessage = Error_Services('GetMessage')
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'A pack scan already exists for the lot operation. Please remove the pack before adding a new one.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'USER ID: ' UserId : ' not found.'
|
||||
end
|
||||
end else
|
||||
ErrorMessage = 'LOT_OPERATION: ' LotOperationId : ' not found.'
|
||||
end
|
||||
If ErrorMessage NE '' then
|
||||
Error_Services('Add', ErrorMessage)
|
||||
end
|
||||
|
||||
end service
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user