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

View File

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