Commit Graph

6 Commits

Author SHA1 Message Date
Misaka_Company
255bcdb5fe refactor: remove debug output and update order logic
- Commented out verbose Debug.Print statements in `GetMaterialsByModel` and `FilterCategoryWithSubcategories` to reduce console noise.
- Added validation checks to ensure required worksheets ('平台配置清单', '产品订单') exist before loading data.
- Refactored order processing logic to aggregate results into a Collection for structured output generation, including headers.
2026-01-26 09:13:27 +08:00
Misaka_Company
40a9fe99f4 feat: track and return missing material categories in BOM
- Update GetValidMaterialsByModel to aggregate and return missing
  category names under the "MissingCategories" key.
- Remove debug print statements and unused variables to improve
  code cleanliness.
- Enhance result visualization to display completeness status
  with color formatting and detailed material tables.
2026-01-21 09:51:37 +08:00
Misaka_Company
112a89a2a4 feat: Add GetValidMaterialsByModel and completeness check
Implemented logic to retrieve materials based on a model string and verify if the resulting set is complete.

Added:
- `GetValidMaterialsByModel`: Parses the model, extracts conditions, and matches materials against root categories.
- `CheckCategoryCompleteness`: Recursively validates categories to ensure exactly one material match per required category (leaf or parent).

This enables the BOM Manager to return a collection of materials alongside a boolean flag indicating if the collection satisfies the structural completeness rules.
2026-01-20 18:13:11 +08:00
Misaka_Company
f3fc5b4cbd feat(clsBOMManager): add optional autoFallback param
Added the `autoFallback` optional parameter to `GetMaterialsByModel`.
This flag controls whether the search automatically descends to
subcategories when no matches are found in the target category.

- Defaults to True to maintain previous recursive behavior.
- When False, the search is restricted strictly to the specified category.
- Updated documentation with usage examples and logic explanations.
2026-01-20 16:24:49 +08:00
Misaka_Company
388ccc4e7a refactor: add subcategory fallback logic for material filtering
Refactored the material retrieval logic in GetMaterialsByModel to
automatically search within subcategories if no matches are found in the
specified parent category.

- Added FilterCategoryWithSubcategories helper function to handle recursive
  searching and fallback logic.
- Restructured main function to delegate filtering to the new helper.
- Enhanced code comments to clarify the step-by-step matching process.
2026-01-20 15:31:43 +08:00
Misaka_Company
a1347017e3 docs: expand AutoBOM architecture and implementation details
Refine project overview to include specific business context (Blaidy Company) and the main workbook file. Restructure the architecture section into a layered object-oriented design (Data, Processing, Application layers) and define the responsibilities of core VBA classes.

Add new technical documentation sections covering:
- Model number format parsing structure
- Condition expression language syntax
- Category hierarchy logic and picking strategies
- Material matching pipeline flow

Include VBA code examples for key methods such as CollectAllMaterials and GetMaterialsByCategoryAndModel to illustrate recursive traversal and material retrieval logic. Clarify the structure of key Excel configuration sheets.
2026-01-20 13:42:03 +08:00