Files
AutoBOM-BOMForge/VBA/ClassModules/cProcessor_CloneNew.cls
Misaka_Company b73e39eeee Refactor strategy pattern to implement separation of concerns
- Update IModuleProcessor interface to accept targetBOMs collection instead of targetItemName string
- Remove filtering logic from strategy implementations (AppendOnly, CloneNew)
- Add LoadData method to mSpecAdditionManager for UI initialization
- Rename ExecuteAddition to ExecutePipeline with refined parameters
- Enhance test suite to simulate fine-grained UI selection behavior
- Enable precise row-level control by delegating filtering to UI layer

This refactoring achieves better separation of concerns where:
- Strategy layer focuses purely on execution logic
- UI layer handles selection and filtering
- Manager layer coordinates the pipeline flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 15:04:24 +08:00

29 lines
1.1 KiB
OpenEdge ABL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
' ==============================================================================
' 模块名称: cProcessor_CloneNew
' 模块类别: 类模块
' 模块职责: 通用克隆新增策略。
' 逻辑描述: 遍历传入的 targetBOMs 母版集合,每遇到一个就克隆一行追加到总库,并赋新值。
' ==============================================================================
Option Explicit
Implements IModuleProcessor
Private Sub IModuleProcessor_ProcessSpec( _
ByRef allBOMs As Collection, _
ByRef targetBOMs As Collection, _
ByVal paramName As String, _
ByVal newValue As String, _
ByRef engine As cConditionEngine)
Dim rowObj As cBOMRow
Dim newRow As cBOMRow
' 为 targetBOMs 里的每一个母版克隆出一个新对象
For Each rowObj In targetBOMs
' 调用数据访问层的克隆方法,自动加入 allBOMs 总集合
Set newRow = mBOMRepository.InsertNewBOMRow(allBOMs, rowObj)
' (lcfw=M19)
newRow.Condition = paramName & "=" & newValue
Next rowObj
End Sub