refactor: replace row index with production order number in error reports
All checks were successful
NTFY Notification / notify (push) Successful in 12s
All checks were successful
NTFY Notification / notify (push) Successful in 12s
Replace "原表行号" (original row number) field with "生产订单号" (production order number) in BOM Extraction System error reporting to improve traceability. Changes: - clsErrorLogger: Update Record/RecordWarning signatures to accept OrderNo (String) instead of RowIndex (Long) - M09_BOMExtractor: Propagate productionOrderNo through validation chain for context-aware error reporting - M06/M07/M08: Use empty string for system-level errors without production order context - Error report header: Change column B from "原表行号" to "生产订单号" Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -77,7 +77,7 @@ Private Sub LoadInventoryData(ByVal inventoryWb As Workbook)
|
||||
If wsInventory Is Nothing Then
|
||||
' 未找到现存量工作表,记录警告并使用空字典(所有库存视为0)
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.RecordWarning 0, "M08.LoadInventoryData", "InventorySheetMissing", _
|
||||
g_Logger.RecordWarning "", "M08.LoadInventoryData", "InventorySheetMissing", _
|
||||
"未找到[" & INVENTORY_SHEET_NAME & "]工作表,所有部件库存将视为0", ""
|
||||
End If
|
||||
Exit Sub
|
||||
@@ -109,7 +109,7 @@ Private Sub LoadInventoryData(ByVal inventoryWb As Workbook)
|
||||
|
||||
ErrorHandler:
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.RecordWarning 0, "M08.LoadInventoryData", "LoadError", _
|
||||
g_Logger.RecordWarning "", "M08.LoadInventoryData", "LoadError", _
|
||||
"加载库存数据失败: " & Err.Description, ""
|
||||
End If
|
||||
End Sub
|
||||
@@ -197,7 +197,7 @@ Public Function ProcessComponentRecord( _
|
||||
|
||||
ErrorHandler:
|
||||
If Not logger Is Nothing Then
|
||||
logger.Record matchedRowNum, "M08.ProcessComponentRecord", "SystemError", _
|
||||
logger.Record "", "M08.ProcessComponentRecord", "SystemError", _
|
||||
"处理部件记录失败: " & Err.Description, ""
|
||||
End If
|
||||
|
||||
@@ -291,7 +291,7 @@ Private Function CheckComponentInventory( _
|
||||
If g_InventoryDict Is Nothing Or Not g_InventoryDict.Exists(componentCode) Then
|
||||
' 未找到库存数据,记录警告并返回False(库存不足)
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.RecordWarning rowNum, "M08.CheckComponentInventory", "InventoryNotFound", _
|
||||
g_Logger.RecordWarning "", "M08.CheckComponentInventory", "InventoryNotFound", _
|
||||
"部件[" & componentCode & "]未找到库存数据,视为库存不足", ""
|
||||
End If
|
||||
CheckComponentInventory = False
|
||||
@@ -321,7 +321,7 @@ Private Function CheckComponentInventory( _
|
||||
Else
|
||||
' 库存不足,记录错误
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.Record rowNum, "M08.CheckComponentInventory", "InsufficientInventory", _
|
||||
g_Logger.Record "", "M08.CheckComponentInventory", "InsufficientInventory", _
|
||||
"部件[" & componentCode & "]库存不足。库存=" & stockQty & ", 累计需求=" & totalDemand, ""
|
||||
End If
|
||||
CheckComponentInventory = False
|
||||
@@ -331,7 +331,7 @@ Private Function CheckComponentInventory( _
|
||||
|
||||
ErrorHandler:
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.Record rowNum, "M08.CheckComponentInventory", "SystemError", _
|
||||
g_Logger.Record "", "M08.CheckComponentInventory", "SystemError", _
|
||||
"库存检查失败: " & Err.Description, ""
|
||||
End If
|
||||
' 出错时返回False(库存不足)
|
||||
@@ -409,7 +409,7 @@ Private Function ExtractComponentInfo( _
|
||||
|
||||
ErrorHandler:
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.Record rowNum, "M08.ExtractComponentInfo", "SystemError", _
|
||||
g_Logger.Record "", "M08.ExtractComponentInfo", "SystemError", _
|
||||
"提取部件信息失败: " & Err.Description, componentType
|
||||
End If
|
||||
Set ExtractComponentInfo = Nothing
|
||||
@@ -463,7 +463,7 @@ Private Function ExtractSubComponents( _
|
||||
|
||||
ErrorHandler:
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.Record rowNum, "M08.ExtractSubComponents", "SystemError", _
|
||||
g_Logger.Record "", "M08.ExtractSubComponents", "SystemError", _
|
||||
"提取子件信息失败: " & Err.Description, ""
|
||||
End If
|
||||
Set ExtractSubComponents = New Collection
|
||||
@@ -559,7 +559,7 @@ Private Function ExtractSingleSubComponent( _
|
||||
|
||||
ErrorHandler:
|
||||
If Not g_Logger Is Nothing Then
|
||||
g_Logger.Record rowNum, "M08.ExtractSingleSubComponent", "SystemError", _
|
||||
g_Logger.Record "", "M08.ExtractSingleSubComponent", "SystemError", _
|
||||
"提取子件[" & subComponentType & "]失败: " & Err.Description, ""
|
||||
End If
|
||||
Set ExtractSingleSubComponent = Nothing
|
||||
|
||||
Reference in New Issue
Block a user