refactor: rename RunBOMExtraction to BOMExtraction for consistency
All checks were successful
NTFY Notification / notify (push) Successful in 4s

Rename the main BOM extraction function from RunBOMExtraction to BOMExtraction
to follow consistent naming conventions across the codebase.

Changes:
- M09_BOMExtractor.bas: Rename function RunBOMExtraction → BOMExtraction
- M01_Main.bas: Update function call to use new name
- Update all internal return statements and logger references

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-27 12:24:12 +08:00
parent 7cb025c243
commit c08a2f34e1
2 changed files with 11 additions and 11 deletions

View File

@@ -143,7 +143,7 @@ End Sub
' ------------------------------------------------------------------------------
Public Sub RunBOMExtraction()
Dim result As String
result = M09_BOMExtractor.RunBOMExtraction()
result = BOMExtraction()
MsgBox result, vbInformation, "BOM提取"
End Sub

View File

@@ -46,10 +46,10 @@ Private g_BOMWorkbook As Workbook
'
' 示例调用:
' Dim result As String
' result = M09_BOMExtractor.RunBOMExtraction()
' result = M09_BOMExtractor.BOMExtraction()
' MsgBox result
' ------------------------------------------------------------------------------
Public Function RunBOMExtraction() As String
Public Function BOMExtraction() As String
On Error GoTo MainErrorHandler
' 初始化
@@ -65,7 +65,7 @@ Public Function RunBOMExtraction() As String
Set wsInput = ThisWorkbook.Worksheets("产品型号")
If wsInput Is Nothing Then
RunBOMExtraction = "错误:未找到输入工作表。工作表名称应包含'" & INPUT_COL_MODEL & "'或'" & INPUT_COL_PRODUCT_MODEL & "'。"
BOMExtraction = "错误:未找到输入工作表。工作表名称应包含'" & INPUT_COL_MODEL & "'或'" & INPUT_COL_PRODUCT_MODEL & "'。"
GoTo ExitHandler
End If
@@ -76,7 +76,7 @@ Public Function RunBOMExtraction() As String
inputModels = ReadInputModels(wsInput)
If IsEmpty(inputModels) Then
RunBOMExtraction = "错误:未找到产品型号数据。请检查工作表中是否有数据。"
BOMExtraction = "错误:未找到产品型号数据。请检查工作表中是否有数据。"
GoTo ExitHandler
End If
@@ -86,7 +86,7 @@ Public Function RunBOMExtraction() As String
Set g_BOMWorkbook = OpenBOMLibrary()
If g_BOMWorkbook Is Nothing Then
RunBOMExtraction = "错误无法打开BOM库文件。请确保[" & BOMLIB_FILENAME & "]与当前工作簿在同一目录下。"
BOMExtraction = "错误无法打开BOM库文件。请确保[" & BOMLIB_FILENAME & "]与当前工作簿在同一目录下。"
GoTo ExitHandler
End If
@@ -106,7 +106,7 @@ Public Function RunBOMExtraction() As String
M06A_Mapper.InitMapper g_Logger, wsMapping
Else
If Not g_Logger Is Nothing Then
g_Logger.RecordWarning "", "M09.RunBOMExtraction", "MappingTableMissing", _
g_Logger.RecordWarning "", "M09.BOMExtraction", "MappingTableMissing", _
"未找到对照表工作表azxs和lcfw将仅使用原始值匹配", ""
End If
End If
@@ -173,7 +173,7 @@ Public Function RunBOMExtraction() As String
Set wsBIPUpload = WriteBIPUploadResults(allResults, inputModels, productCodeMap)
If wsBIPUpload Is Nothing Then
RunBOMExtraction = "错误无法生成BIP上传工作表。"
BOMExtraction = "错误无法生成BIP上传工作表。"
GoTo ExitHandler
End If
@@ -184,7 +184,7 @@ Public Function RunBOMExtraction() As String
Set wsInventoryCompare = WriteInventoryComparisonResults(allResults, inputModels)
If wsInventoryCompare Is Nothing Then
RunBOMExtraction = "错误:无法生成库存比对工作表。"
BOMExtraction = "错误:无法生成库存比对工作表。"
GoTo ExitHandler
End If
@@ -227,11 +227,11 @@ Public Function RunBOMExtraction() As String
msg = msg & vbCrLf & vbCrLf & "发现警告,已生成错误报告工作表。"
End If
RunBOMExtraction = msg
BOMExtraction = msg
GoTo ExitHandler
MainErrorHandler:
RunBOMExtraction = "发生运行时错误: " & err.Description & " (错误号: " & err.Number & ")"
BOMExtraction = "发生运行时错误: " & err.Description & " (错误号: " & err.Number & ")"
ExitHandler:
' 清理