Merged PR 21245: Added in a check for the active flag when adding an operation to a lot. Added...

Added in a check for the active flag when adding an operation to a lot. Added in material handler group to the CanUserModifyLot check.

Given the addition of a check for the active flag to allow adding an operation. I checked all OPERATION records to ensure that flag has already been set. The only operations that had a value other than true were the OPERATION records related to Return To Fab Lot processing.

Tested and verified creating test wafer lots, and creating RTF forms.
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-07-22 00:31:04 +02:00
parent e1a44a7687
commit ea156489f1
2 changed files with 69 additions and 62 deletions

View File

@ -29,68 +29,73 @@ Service AddOperationToLot(LotId, OperationId, PrescribedSequence, UserId)
ErrorMessage = '' ErrorMessage = ''
If RowExists('LOT', LotId) then If RowExists('LOT', LotId) then
If RowExists('OPERATION', OperationId) then If RowExists('OPERATION', OperationId) then
If PrescribedSequence AND Num(PrescribedSequence) then OperationActive = XLATE('OPERATION', OperationId, OPERATION_ACTIVE$, 'X')
If Lot_Services('CanUserModifyLot', UserId) then If OperationActive then
LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId) If PrescribedSequence AND Num(PrescribedSequence) then
CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X') If Lot_Services('CanUserModifyLot', UserId) then
If CurrOperationSequence LT PrescribedSequence then LotCurrOperation = Lot_Services('GetLotCurrOperationId', LotId)
//Get Curr Operation Sequence CurrOperationSequence = Xlate('LOT_OPERATION', LotCurrOperation, LOT_OPERATION_OPERATION_SEQUENCE$, 'X')
Done = False$ If CurrOperationSequence LT PrescribedSequence then
LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId) //Get Curr Operation Sequence
for each Operation in LotCurrOperationSequence using @Fm setting OpPos Done = False$
ThisOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', Operation) LotCurrOperationSequence = Lot_Services('GetLotOperationSequence', LotId)
ThisOperationSequence = ThisOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> for each Operation in LotCurrOperationSequence using @Fm setting OpPos
If ThisOperationSequence GE PrescribedSequence then ThisOperationRec = Database_Services('ReadDataRow', 'LOT_OPERATION', Operation)
NewOperationSequence = ThisOperationSequence + 1 ThisOperationSequence = ThisOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$>
ThisOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = NewOperationSequence If ThisOperationSequence GE PrescribedSequence then
Database_Services('WriteDataRow', 'LOT_OPERATION', Operation, ThisOperationRec) NewOperationSequence = ThisOperationSequence + 1
If Error_Services('HasError') then ThisOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = NewOperationSequence
Done = True$ Database_Services('WriteDataRow', 'LOT_OPERATION', Operation, ThisOperationRec)
ErrorMessage = Error_Services('GetMessage') If Error_Services('HasError') then
end Done = True$
end ErrorMessage = Error_Services('GetMessage')
Until Done end
Next Operation end
If ErrorMessage EQ '' then Until Done
LotOperationRecID = RTI_CreateGUID() Next Operation
If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then If ErrorMessage EQ '' then
OperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) LotOperationRecID = RTI_CreateGUID()
Class = OperationRec<OPERATION_CLASS_ID$> If Not(RowExists('LOT_OPERATION', LotOperationRecID)) then
Type = OperationRec<OPERATION_TYPE$> OperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId)
Rework = OperationRec<OPERATION_REWORK$> Class = OperationRec<OPERATION_CLASS_ID$>
ThisNewOperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId) Type = OperationRec<OPERATION_TYPE$>
LotOperationRec = '' Rework = OperationRec<OPERATION_REWORK$>
LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId ThisNewOperationRec = Database_Services('ReadDataRow', 'OPERATION', OperationId)
LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationId LotOperationRec = ''
LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = PrescribedSequence LotOperationRec<LOT_OPERATION_LOT_ID$> = LotId
LotOperationRec<LOT_OPERATION_REWORK$> = Rework LotOperationRec<LOT_OPERATION_OPERATION_ID$> = OperationId
LotOperationRec<LOT_OPERATION_OPERATION_TYPE$> = Type LotOperationRec<LOT_OPERATION_OPERATION_SEQUENCE$> = PrescribedSequence
LotOperationRec<LOT_OPERATION_OPERATION_CLASS$> = Class LotOperationRec<LOT_OPERATION_REWORK$> = Rework
LotOperationRec<LOT_OPERATION_MET_TEST_TYPE_REQUIRED$> = OperationRec<OPERATION_MET_TEST_TYPE_REQUIRED$> LotOperationRec<LOT_OPERATION_OPERATION_TYPE$> = Type
LotOperationRec<LOT_OPERATION_MET_TEST_REQUIRED$> = OperationRec<OPERATION_MET_TEST_REQUIRED$> LotOperationRec<LOT_OPERATION_OPERATION_CLASS$> = Class
LotOperationRec<LOT_OPERATION_PACKAGING_REQUIRED$> = OperationRec<OPERATION_PACKAGING_REQUIRED$> LotOperationRec<LOT_OPERATION_MET_TEST_TYPE_REQUIRED$> = OperationRec<OPERATION_MET_TEST_TYPE_REQUIRED$>
LotOperationRec<LOT_OPERATION_CLEAN_REQUIRED$> = OperationRec<OPERATION_CLEAN_REQUIRED$> LotOperationRec<LOT_OPERATION_MET_TEST_REQUIRED$> = OperationRec<OPERATION_MET_TEST_REQUIRED$>
LotOperationRec<LOT_OPERATION_WAFER_COUNTER_REQUIRED$> = OperationRec<OPERATION_WAFER_COUNTER_REQUIRED$> LotOperationRec<LOT_OPERATION_PACKAGING_REQUIRED$> = OperationRec<OPERATION_PACKAGING_REQUIRED$>
IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$) LotOperationRec<LOT_OPERATION_CLEAN_REQUIRED$> = OperationRec<OPERATION_CLEAN_REQUIRED$>
Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec) LotOperationRec<LOT_OPERATION_WAFER_COUNTER_REQUIRED$> = OperationRec<OPERATION_WAFER_COUNTER_REQUIRED$>
If Error_Services('NoError') then IsOperationRework = Database_Services('ReadDataColumn', 'OPERATION', OperationId, OPERATION_REWORK$)
OperationDesc = XLATE('OPERATION', OperationId, OPERATION_OPERATION_DESCRIPTION$, 'X') Database_Services('WriteDataRow', 'LOT_OPERATION', LotOperationRecId, LotOperationRec)
Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Quote(OperationDesc) : ' to lot.', '', UserId) If Error_Services('NoError') then
end else OperationDesc = XLATE('OPERATION', OperationId, OPERATION_OPERATION_DESCRIPTION$, 'X')
ErrorMessage = Error_Services('GetMessage') Lot_Event_Services('CreateLotEvent', LotId, Datetime(), 'ADD_LOT_OPERATION', 'Added operation ' : Quote(OperationDesc) : ' to lot.', '', UserId)
end end else
end else ErrorMessage = Error_Services('GetMessage')
ErrorMessage = 'Lot Operation already existed, cannot overwrite' end
end end else
end ErrorMessage = 'Lot Operation already existed, cannot overwrite'
end else end
ErrorMessage = 'Not allowed to add new operations prior to current operation' end
end end else
end else ErrorMessage = 'Not allowed to add new operations prior to current operation'
ErrorMessage = 'User ' : UserId : ' does not have permission to modify lots.' end
end end else
ErrorMessage = 'User ' : UserId : ' does not have permission to modify lots.'
end
end else
ErrorMessage = 'Invalid operation sequence entered.'
end
end else end else
ErrorMessage = 'Invalid operation sequence entered.' ErrorMessage = 'Operation is inactive. Unable to add.'
end end
end else end else
ErrorMessage = 'Operation ' : OperationId : 'not found in OPERATION table.' ErrorMessage = 'Operation ' : OperationId : 'not found in OPERATION table.'

View File

@ -1599,6 +1599,8 @@ Service CanUserModifyLot(UserId)
Response = true$ Response = true$
Case MemberOf(UserId, 'LEAD') Case MemberOf(UserId, 'LEAD')
Response = true$ Response = true$
Case MemberOf(UserId, 'MATERIAL_HANDLER')
Response = true$
Case UserId EQ 'SYSTEM' Case UserId EQ 'SYSTEM'
Response = true$ Response = true$
Case Otherwise$ Case Otherwise$