Major refactoring of BOM matching error handling mechanism to separate
matching phase from validation phase, enabling cross-worksheet validation
and non-blocking warnings.
Changes:
- clsErrorLogger: Add warning support
- Add RecordWarning() method for non-blocking issues
- Add HasWarnings and HasIssues properties
- Update PrintReport() to show errors and warnings with color coding
- Add "Type" column to distinguish errors from warnings
- M09_BOMExtractor: Implement two-phase validation
- Replace MatchAllMaterialTypes() with MatchAllMaterialTypesWithValidation()
- Add ValidateAllMatchResults() for unified cross-worksheet validation
- Phase 1 (Collection): Gather all worksheet matches without recording errors
- Phase 2 (Validation): Validate all results with special rules for components
- Phase 3 (Generation): Create final material collection based on validation
- Add ToArray() helper for Collection to Array conversion
- Enhanced component/joint/element validation:
- Support warnings for non-blocking conflicts (e.g., component + joint both matched)
- Better cross-validation between "部件", "接头", "弹性元件" worksheets
- Distinguish between errors (blocking) and warnings (non-blocking)
- Documentation updates:
- Update BOM匹配错误判断机制详解.md to v2.0
- Document two-phase verification approach
- Add warning scenarios and handling
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add BOM library column name constants (名称, 编码, 数量, etc.)
- Add GetBOMConditionFields() and IsConditionField() utility functions
- Refactor ExtractMaterialInfo to use column names instead of hardcoded positions
- Refactor ExtractSingleSubComponent to use column names for 接头/弹性元件
- Refactor ExtractComponentInfo to use column names
- Improve MatchAllMaterialTypes to iterate all worksheets dynamically
- Add debug logging for troubleshooting
This fix resolves issues where worksheets with non-standard column counts
(like 表壳, 罩壳) could not extract material information properly.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add BOM auto-extraction system requirements specification
- Minor property name fixes in M05_PreProcessor (.Pattern -> .pattern)
- Fix .Row property references to .row for consistency
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add complete BOM auto-extraction system with the following modules:
- M06_ModelParser: Parse product model strings to extract parameters
(azxs, bkxs, gclj, jycz, lcfw, fjgn)
- Extracts header part from full model (ignores dial/attachment parts)
- Splits process connection and material code (G123 -> G12, 3)
- Supports multiple additional features with comma/dot separators
- M07_BOMMatcher: Match materials in BOM library
- Exact match, wildcard (empty cell), negative match (!=)
- Special fjgn contains matching logic
- Array-based performance optimization for bulk operations
- M08_ComponentProcessor: Handle component material special logic
- Component inventory check (interface reserved)
- Sub-component extraction (joint + elastic element)
- Combination validation rules (1 component OR 1 joint + 1 element)
- M09_BOMExtractor: Main extraction orchestrator
- Reads input models from worksheet
- Processes each model and matches all material types
- Outputs to "BOM提取结果" worksheet
- Error reporting and non-blocking design
- M06B_TestRunner: Comprehensive unit tests
- 8 test cases for model parsing
- 5 test cases for BOM matching
- 5 test cases for component processing
- M04_Config: Add BOM extraction constants
- BOM library filename and configuration
- Input/output column definitions
- Output column enumeration
- M01_Main: Add RunBOMExtraction entry point
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename VBA/ directory to VBA_BOMConverter/ for better clarity.
This change reflects the module's purpose as the BOM converter component.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>