feat: add implementation plan for order material extraction functionality
- Introduced a comprehensive document detailing the project overview, goals, core functionalities, and technical architecture for the order material extraction feature. - Defined the product model coding rules and extraction logic for selection conditions. - Designed class structures for model parsing, condition evaluation, and order material list management. - Outlined implementation steps, testing plans, and risk assessments for the development process.
This commit is contained in:
@@ -19,15 +19,15 @@ Sub TestBOMStructure()
|
||||
bomMgr.LoadData wsConfig, wsPlatform
|
||||
|
||||
' 打印类别树结构到新工作表
|
||||
Dim wsOutput As Worksheet
|
||||
On Error Resume Next
|
||||
Application.DisplayAlerts = False
|
||||
ThisWorkbook.Worksheets("BOM结构").Delete
|
||||
Application.DisplayAlerts = True
|
||||
On Error GoTo 0
|
||||
|
||||
Set wsOutput = ThisWorkbook.Worksheets.Add
|
||||
wsOutput.Name = "BOM结构"
|
||||
' Dim wsOutput As Worksheet
|
||||
' On Error Resume Next
|
||||
' Application.DisplayAlerts = False
|
||||
' ThisWorkbook.Worksheets("BOM结构").Delete
|
||||
' Application.DisplayAlerts = True
|
||||
' On Error GoTo 0
|
||||
'
|
||||
' Set wsOutput = ThisWorkbook.Worksheets.Add
|
||||
' wsOutput.Name = "BOM结构"
|
||||
|
||||
'bomMgr.PrintCategoryTree wsOutput
|
||||
|
||||
@@ -40,7 +40,7 @@ Sub TestBOMStructure()
|
||||
|
||||
|
||||
|
||||
MsgBox "BOM数据结构加载完成!" & vbCrLf & _
|
||||
'MsgBox "BOM数据结构加载完成!" & vbCrLf & _
|
||||
"请查看 'BOM结构' 工作表", vbInformation
|
||||
End Sub
|
||||
|
||||
@@ -139,6 +139,64 @@ Sub GeneratePickingList()
|
||||
MsgBox "领料清单生成完成!", vbInformation
|
||||
End Sub
|
||||
|
||||
' 示例: 在立即窗口打印领料清单
|
||||
Sub PrintPickingList()
|
||||
Dim bomMgr As New clsBOMManager
|
||||
Dim wsConfig As Worksheet, wsPlatform As Worksheet
|
||||
|
||||
Set wsConfig = ThisWorkbook.Worksheets("领料配置")
|
||||
Set wsPlatform = ThisWorkbook.Worksheets("平台配置清单")
|
||||
|
||||
bomMgr.LoadData wsConfig, wsPlatform
|
||||
|
||||
' 打印表头
|
||||
Debug.Print String(80, "=")
|
||||
Debug.Print "领料清单"
|
||||
Debug.Print String(80, "=")
|
||||
|
||||
' 遍历所有根类别
|
||||
Dim rootCats As Collection
|
||||
Set rootCats = bomMgr.GetRootCategories
|
||||
|
||||
Dim cat As clsCategory
|
||||
Dim Materials As Collection
|
||||
Dim mat As clsMaterialItem
|
||||
Dim i As Long, j As Long
|
||||
Dim totalCount As Long
|
||||
|
||||
totalCount = 0
|
||||
|
||||
For i = 1 To rootCats.Count
|
||||
Set cat = rootCats(i)
|
||||
|
||||
' 打印类别分隔符
|
||||
Debug.Print ""
|
||||
Debug.Print "【类别: " & cat.categoryName & "】"
|
||||
Debug.Print String(40, "-")
|
||||
|
||||
' 默认使用父类别物料
|
||||
Set Materials = bomMgr.GetMaterialsForPicking(cat.categoryName, True)
|
||||
|
||||
For j = 1 To Materials.Count
|
||||
Set mat = Materials(j)
|
||||
Debug.Print " " & mat.code & _
|
||||
String(20 - Len(mat.code), " ") & _
|
||||
mat.Name & _
|
||||
" | 数量:" & mat.Quantity & _
|
||||
" | 条件:" & IIf(mat.Condition = "", "(无)", mat.Condition)
|
||||
totalCount = totalCount + 1
|
||||
Next j
|
||||
|
||||
Debug.Print " 小计: " & Materials.Count & " 项"
|
||||
Next i
|
||||
|
||||
' 打印汇总
|
||||
Debug.Print ""
|
||||
Debug.Print String(80, "=")
|
||||
Debug.Print "总计: " & totalCount & " 项物料"
|
||||
Debug.Print String(80, "=")
|
||||
End Sub
|
||||
|
||||
' 示例: 查询特定物料信息
|
||||
Sub QueryMaterialInfo()
|
||||
Dim bomMgr As New clsBOMManager
|
||||
|
||||
Reference in New Issue
Block a user