🎨 style: standardize parameter naming to camelCase
Refactor parameter and property names from PascalCase to camelCase for consistent naming conventions across VBA modules. Changes: - Conditions → conditions (property and parameters) - Update all references across 7 modules - Maintain functional behavior while improving code readability Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -184,13 +184,13 @@ Private Sub ProcessSingleModel(totalQueueNum As String, _
|
||||
If Not parser.Parse(modelString) Then
|
||||
' 解析失败
|
||||
extractNote = "解析失败: " & parser.ErrorMessage
|
||||
outputData.Add CreateOutputRowArray(totalQueueNum, orderNumber, modelString, parser.Conditions, extractNote, Nothing)
|
||||
outputData.Add CreateOutputRowArray(totalQueueNum, orderNumber, modelString, parser.conditions, extractNote, Nothing)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' 提取BOM
|
||||
Dim matchedItems As Collection
|
||||
Set matchedItems = BomExtractor.ExtractBom(parser.Conditions)
|
||||
Set matchedItems = BomExtractor.ExtractBom(parser.conditions)
|
||||
|
||||
' 获取错误信息
|
||||
Dim bomErrors As String
|
||||
@@ -205,7 +205,7 @@ Private Sub ProcessSingleModel(totalQueueNum As String, _
|
||||
If extractNote = "" Then
|
||||
extractNote = "未匹配到任何物料"
|
||||
End If
|
||||
outputData.Add CreateOutputRowArray(totalQueueNum, orderNumber, modelString, parser.Conditions, extractNote, Nothing)
|
||||
outputData.Add CreateOutputRowArray(totalQueueNum, orderNumber, modelString, parser.conditions, extractNote, Nothing)
|
||||
Else
|
||||
' 输出每个匹配的物料
|
||||
Dim item As BomItem
|
||||
@@ -224,11 +224,11 @@ Private Sub ProcessSingleModel(totalQueueNum As String, _
|
||||
|
||||
If isFirst Then
|
||||
' 首行保留总排号和订单号
|
||||
outputData.Add CreateOutputRowArray(totalQueueNum, orderNumber, modelString, parser.Conditions, itemNote, item)
|
||||
outputData.Add CreateOutputRowArray(totalQueueNum, orderNumber, modelString, parser.conditions, itemNote, item)
|
||||
isFirst = False
|
||||
Else
|
||||
' 同一个型号的后续BOM项,总排号和订单号留空以保持报表整洁
|
||||
outputData.Add CreateOutputRowArray("", "", modelString, parser.Conditions, itemNote, item)
|
||||
outputData.Add CreateOutputRowArray("", "", modelString, parser.conditions, itemNote, item)
|
||||
End If
|
||||
Next item
|
||||
End If
|
||||
@@ -249,12 +249,12 @@ Private Sub WriteOutputHeader(ws As Worksheet)
|
||||
ws.Cells(1, col).value = "产品型号": col = col + 1
|
||||
|
||||
' 写入条件字段表头
|
||||
Dim Conditions() As String
|
||||
Dim conditions() As String
|
||||
Dim labels() As String
|
||||
GetConditionConfig Conditions, labels
|
||||
GetConditionConfig conditions, labels
|
||||
|
||||
Dim i As Long
|
||||
For i = LBound(Conditions) To UBound(Conditions)
|
||||
For i = LBound(conditions) To UBound(conditions)
|
||||
ws.Cells(1, col).value = labels(i)
|
||||
col = col + 1
|
||||
Next i
|
||||
@@ -283,7 +283,7 @@ End Sub
|
||||
Private Function CreateOutputRowArray(totalQueueNum As String, _
|
||||
orderNumber As String, _
|
||||
FullModel As String, _
|
||||
Conditions As Object, _
|
||||
conditions As Object, _
|
||||
note As String, _
|
||||
item As BomItem) As Variant()
|
||||
' 获取条件配置
|
||||
@@ -309,8 +309,8 @@ Private Function CreateOutputRowArray(totalQueueNum As String, _
|
||||
' 写入条件值
|
||||
Dim i As Long
|
||||
For i = LBound(condNames) To UBound(condNames)
|
||||
If Conditions.Exists(condNames(i)) Then
|
||||
rowData(col) = Conditions(condNames(i))
|
||||
If conditions.Exists(condNames(i)) Then
|
||||
rowData(col) = conditions(condNames(i))
|
||||
Else
|
||||
rowData(col) = ""
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user