refactor: replace row index with production order number in error reports
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:
Misaka_Company
2026-02-26 10:12:59 +08:00
parent 8477792d41
commit 7fea574531
5 changed files with 32 additions and 30 deletions

View File

@@ -13,9 +13,9 @@ Private Sub Class_Initialize()
End Sub
' 记录错误
Public Sub Record(RowIndex As Long, SourceFunc As String, ErrorType As String, Desc As String, Context As String)
' 使用数组存储单条错误信息:号, 来源, 类型, 描述, 上下文
pErrors.Add Array(RowIndex, SourceFunc, ErrorType, Desc, Context)
Public Sub Record(OrderNo As String, SourceFunc As String, ErrorType As String, Desc As String, Context As String)
' 使用数组存储单条错误信息:生产订单号, 来源, 类型, 描述, 上下文
pErrors.Add Array(OrderNo, SourceFunc, ErrorType, Desc, Context)
End Sub
' 是否有错误
@@ -34,8 +34,8 @@ Public Property Get HasIssues() As Boolean
End Property
' 记录警告
Public Sub RecordWarning(RowIndex As Long, SourceFunc As String, WarningType As String, Desc As String, Context As String)
pWarnings.Add Array(RowIndex, SourceFunc, WarningType, Desc, Context)
Public Sub RecordWarning(OrderNo As String, SourceFunc As String, WarningType As String, Desc As String, Context As String)
pWarnings.Add Array(OrderNo, SourceFunc, WarningType, Desc, Context)
End Sub
'
@@ -47,7 +47,7 @@ Public Sub PrintReport(targetWb As Workbook)
ws.Name = "错误报告_" & Format(Now, "hhmmss")
' ("类型")
ws.Range("A1:F1").Value = Array("类型", "原表行号", "来源模块", "错误类型", "详细描述", "原始数据")
ws.Range("A1:F1").Value = Array("类型", "生产订单号", "来源模块", "错误类型", "详细描述", "原始数据")
ws.Range("A1:F1").Font.Bold = True
ws.Range("A1:F1").Interior.Color = RGB(217, 217, 217)