Commit Graph

64 Commits

Author SHA1 Message Date
Misaka_Company
7fea574531 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>
2026-02-26 10:12:59 +08:00
Misaka_Company
8477792d41 feat: integrate inventory verification for component materials in BOM extraction
All checks were successful
NTFY Notification / notify (push) Successful in 7s
Implement inventory-based component selection logic that accumulates demand
across orders and falls back to sub-components (joint + element) when stock
is insufficient.

**Changes:**
- M04_Config: Add inventory worksheet configuration constants
  - INVENTORY_SHEET_NAME = "现存量"
  - INVENTORY_HEADER_ROW = 3 (headers on row 3)
  - INVENTORY_COL_CODE = "B" (material code)
  - INVENTORY_COL_QTY = "J" (stock quantity)

- M08_ComponentProcessor: Implement inventory tracking and verification
  - Add module-level variables: g_InventoryDict, g_AccumulatedDemandDict
  - Add LoadInventoryData() to load stock from [现存量] worksheet
  - Add InitComponentProcessorWithInventory() for initialization with inventory
  - Rewrite CheckComponentInventory() with actual inventory logic:
    * Calculate cumulative demand = orderQty × bomQty + previousAccumulated
    * Compare with available stock
    * Return True if stock sufficient, False otherwise
    * Update accumulated demand after each order
  - Update ProcessComponentRecord() to accept orderQty parameter

- M09_BOMExtractor: Integrate inventory check into main workflow
  - Modify ReadInputModels() to read 3 columns (orderNo, model, qty)
  - Initialize component processor with inventory support
  - Extract order quantity from column C and pass through call chain
  - Update ProcessSingleModel() and MatchAllMaterialTypesWithValidation()
    signatures to accept orderQty parameter

**Logic Example:**
- 3 orders (PO-001, PO-003, PO-006) use component A
- Each order: quantity=2, BOM qty=1, stock=5
- PO-001: cumulative=2, stock 5>=2 ✓ → return component
- PO-003: cumulative=4, stock 5>=4 ✓ → return component
- PO-006: cumulative=6, stock 5<6 ✗ → return sub-components

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-24 16:21:18 +08:00
Misaka_Company
24a54bd1ea feat: add production order number column to BOM extraction output
All checks were successful
NTFY Notification / notify (push) Successful in 4s
- Add 生产订单号 as the first column in output (13 columns total)
- Read production order number from column A of input worksheet
- Only display production order number on first row for each product model
- Set material code column to text format to preserve leading zeros
- Update OutputColumns enum indices in M04_Config.bas
- Update ReadInputModels to return 2 columns (order number + model)
- Update ProcessSingleModel, GenerateMaterialRow, GenerateErrorRow signatures
- Update WriteExtractionResults to write 13 columns with text formatting

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-24 14:28:24 +08:00
Misaka_Company
0579a546d3 feat: auto-save output workbook as BOM库.xlsx and clean default sheets
All checks were successful
NTFY Notification / notify (push) Successful in 6s
- Delete default sheets (Sheet1, Sheet2, etc.) created by Workbooks.Add
- Save output workbook as BOM库.xlsx in the same directory as source file
- Auto-close workbook after saving
- Update completion message to show save path
- Use ThisWorkbook.Path to get source file directory

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-24 12:50:35 +08:00
Misaka_Company
541bbfe0ad refactor: replace CODE field source from column C to column I (66代码)
All checks were successful
NTFY Notification / notify (push) Successful in 14s
- Add COL_IDX_CODE66 constant for column I in M04_Config.bas
- Extend data reading range to include column I in M02_DataIO.ReadSourceData
- Use .Text property for column I to preserve leading zeros
- Update baseInfo array to use column I instead of column C in M01_Main.bas
- Set output code column to text format to prevent numeric conversion

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-24 12:44:31 +08:00
Misaka_Company
53b3568412 feat: add special validation for edge material based on azxs parameter
All checks were successful
NTFY Notification / notify (push) Successful in 3s
Implement edge material validation logic that behaves differently based on azxs value:
- When azxs is A0, Z0, or B0: Edge material is NOT required (0 matches = OK, 1+ matches = ERROR)
- When azxs is AH, AT, BH, BT, BZ, ZH, ZT, or ZZ: Standard validation applies (exactly 1 match required)
- Supports dual-value azxs format (e.g., "A0,径向" extracts "A0" for validation)

Changes:
- M09_BOMExtractor.bas:
  - Update MatchAllMaterialTypesWithValidation to pass params to validation
  - Update ValidateAllMatchResults signature to accept params parameter
  - Add "边" to special sheets array
  - Implement Phase 3.5: Edge material validation with azxs-based rules
  - Update function header comments

- docs/BOM匹配错误判断机制详解.md:
  - Add section 6.5: Edge material special handling
  - Update error type table with EdgeMaterialError
  - Update function index and version history

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 18:31:33 +08:00
Misaka_Company
1d5bad86f7 feat: add preprocessing with value mapping to BOM Extraction System
All checks were successful
NTFY Notification / notify (push) Successful in 4s
Add a preprocessing step to the BOM Extraction System to enhance parameter
extraction with mapping values from "对照表" worksheet. For azxs (安装形式)
and lcfw (量程范围), the system now stores both the raw parsed value AND the
mapped value from the lookup table, enabling flexible dual-value matching.

Changes:
- Create M06A_Mapper.bas: New module for value mapping
  - Load azxs/lcfw mappings from "对照表" worksheet
  - Return dual-value format "raw,mapped" (e.g., "A0,径向")
  - Support graceful degradation if "对照表" not found
  - Define constants locally to avoid VBA cross-module reference issues

- Modify M06_ModelParser.bas:
  - Extract raw parameter values first
  - Apply mapping via M06A_Mapper if initialized
  - Store dual values for azxs and lcfw parameters

- Modify M07_BOMMatcher.bas:
  - Update EvaluateCellCondition() to support dual-value matching
  - Split by comma and check if ANY value matches
  - Backward compatible with single-value parameters

- Modify M09_BOMExtractor.bas:
  - Initialize M06A_Mapper during RunBOMExtraction()
  - Add WorksheetExists() helper function
  - Log warning if "对照表" worksheet not found
  - Define MAPPING_SHEET_NAME constant locally

- Modify M04_Config.bas:
  - Add mapping table configuration constants
  - MAPPING_SHEET_NAME, MAPPING_COL_LCFW_KEY, etc.

- Update CLAUDE.md:
  - Document new M06A_Mapper module
  - Update data flow diagram with mapping step
  - Document dual-value matching behavior
  - Update system architecture diagram

- Update docs/RunBOMExtraction_运行机制详解.md:
  - Add M06A_Mapper to all diagrams and documentation
  - Add detailed value mapping section
  - Update sequence diagrams with mapping flow
  - Update parameter examples with dual-value format
  - Bump documentation version to 3.0

Example:
  Input:  Product model "YTHN-100.A0.531.G123.M04.Y3"
  Parse:  azxs="A0", lcfw="M04"
  Map:    azxs="A0,径向", lcfw="M04,高压"
  Match:  BOM库 with azxs="径向" OR "A0" → MATCH

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 17:52:03 +08:00
Misaka_Company
21f5f1c299 docs: fix parsing phase documentation in data flow diagram
All checks were successful
NTFY Notification / notify (push) Successful in 5s
- Fix incorrect azxs transformation (A0→径向 → A0) - M06_ModelParser returns raw values, not transformed values
- Add missing xh (型号) parameter to diagrams and examples (8 params total, not 7)
- Remove misleading cross-connections between parameters (jycz/lcfw don't flow from gclj/bkxs)
- Fix Mermaid parse error by escaping pipe character (| → 管道符)
- Update all example tables to show raw azxs value "A0" instead of "径向"
- Add comprehensive two-phase validation architecture documentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 17:01:41 +08:00
Misaka_Company
157595a169 docs: update CLAUDE.md to document both BOM systems as functional modules
All checks were successful
NTFY Notification / notify (push) Successful in 4s
- Clearly separate BOM Configuration System (M01-M05) and BOM Extraction System (M06-M09)
- Update Project Overview to describe both functional modules
- Update Architecture section to present both systems with their respective modules
- Update Data Flow to show separate workflows for each system
- Rewrite Key Concepts section with clear separation between systems
- Update Development Commands for both BOM Converter and BOM Extractor
- Update Configuration section with complete system constants for both systems
- Update File Structure to accurately reflect VBA_BOMConverter/ directory layout
- Update Important Notes to cover both systems' specific features

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 16:25:52 +08:00
Misaka_Company
78241f2b8d fix: component worksheet rowCount false positive validation error
Some checks failed
NTFY Notification / notify (push) Failing after 3s
Fix critical bug in BOM matching validation: when [部件] worksheet matches 1 record
but returns 2 sub-components, system incorrectly reports "matched 2 records".

Root Cause:
- matchResult("rowCount") incorrectly used componentMaterials.count (material count)
- instead of bomMatchResult("rowCount") (worksheet row count)
- Caused 1-row match returning 2 sub-components to be misreported as "2 matches"

Solution:
1. M08_ComponentProcessor.ProcessComponentRecord: Add matchedRowNum parameter,
   receive matched row number from caller, avoid redundant internal matching

2. M09_BOMExtractor: Implement two-phase matching flow
   - Phase 1: Call MatchBOMRecord to get standard match result (with correct rowCount)
   - Phase 2: If match succeeds, call ProcessComponentRecord to process component logic
   - matchResult("rowCount") always uses standard match's rowCount (worksheet row count)

Fix Results:
- Scenario 1: [部件] matches 1 row, returns 1 component → rowCount=1 
- Scenario 2: [部件] matches 1 row, returns 2 sub-components → rowCount=1  (no false positive)
- Scenario 3: [部件] matches 0 rows → rowCount=0, correct error 
- Scenario 4: [部件] matches 2+ rows → rowCount=2, correct error 

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 15:54:50 +08:00
Misaka_Company
8271958adf refactor: implement two-phase BOM matching error validation with warning support
All checks were successful
NTFY Notification / notify (push) Successful in 4s
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>
2026-02-12 15:36:23 +08:00
Misaka_Company
68798920d6 docs: add comprehensive error handling mechanism documentation
All checks were successful
NTFY Notification / notify (push) Successful in 3s
Add detailed documentation for error handling system including:
- Error handling architecture with class diagrams
- Error type classification (7 types)
- Complete error handling lifecycle sequence diagrams
- Module-specific error handling patterns (M01/M03/M05/M06/M07/M08/M09)
- Error recovery strategies (continue, graceful degradation, warning only)
- Error report generation process
- Best practices with code examples
- Test coverage overview
- Quick reference guide

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 14:35:30 +08:00
Misaka_Company
80bfafa2f2 docs: add RunBOMExtraction mechanism documentation with Mermaid diagrams
All checks were successful
NTFY Notification / notify (push) Successful in 3s
Add comprehensive documentation for BOM extraction system including:
- System architecture and data flow diagrams
- Core process flowchart with detailed decision points
- Module interaction sequence diagram
- Detailed explanations of 5 key modules (M01/M06/M07/M08/M09)
- Data structures (input/BOM library/output/internal)
- Error handling mechanisms and recovery strategies
- 3 practical usage examples
- Quick reference guide

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 14:13:03 +08:00
Misaka_Company
867b1979af refactor: improve BOM library matching logic with column-name-based lookup
All checks were successful
NTFY Notification / notify (push) Successful in 3s
- 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>
2026-02-12 13:59:48 +08:00
Misaka_Company
c204a8878e docs: add BOM extraction requirements and minor code fixes
All checks were successful
NTFY Notification / notify (push) Successful in 2s
- 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>
2026-02-12 13:03:56 +08:00
Misaka_Company
093a2d0a3b feat: implement BOM auto-extraction system
All checks were successful
NTFY Notification / notify (push) Successful in 11s
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>
2026-02-12 13:02:14 +08:00
Misaka_Company
c6c31f81c8 refactor: rename VBA directory to VBA_BOMConverter
All checks were successful
NTFY Notification / notify (push) Successful in 20s
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>
2026-02-11 10:11:40 +08:00
Misaka_Company
ec579b30b2 feat: add azxs preprocessing support for component category
All checks were successful
NTFY Notification / notify (push) Successful in 13s
Extend M05_PreProcessor to support category-specific preprocessing:
- "接头" category: Full preprocessing (azxs + lcfw mapping, OR merging, parentheses simplification)
- "部件" category: Partial preprocessing (azxs mapping only, OR merging, parentheses simplification)
- Other categories: No preprocessing

Add new function ApplyPreprocessingWithoutLcfw() to handle component category preprocessing.

Add unit tests (PP_09 through PP_12) to verify:
- azxs mapping for component category
- lcfw conditions remain unchanged for component category
- OR condition merging and parentheses simplification

Update CLAUDE.md documentation with category-specific preprocessing table.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 09:49:38 +08:00
Misaka_Company
90a62231e0 refactor: remove preprocessing report prompt from workflow
All checks were successful
NTFY Notification / notify (push) Successful in 4s
Simplify the BOM conversion workflow by removing the interactive prompt for preprocessing report generation. This streamlines the main conversion process.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 16:09:41 +08:00
Misaka_Company
026fd47b77 chore: remove obsolete test documentation
All checks were successful
NTFY Notification / notify (push) Successful in 5s
Remove Test_PP_06_FullIntegration_流程详解.md as preprocessing
workflow is now documented in code comments and CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 14:00:53 +08:00
Misaka_Company
7b2bd25d9a feat: add preprocessing report generator for joint category
Some checks failed
NTFY Notification / notify (push) Failing after 7s
Add GeneratePreprocessingReport() function to create a detailed
comparison report showing condition transformations for "接头" category.
Features include:
- Statistics summary (total rows, success count, OR merges, etc.)
- Detailed comparison table (11 columns: row, code, name, qty, category,
  original condition, converted condition, mapping details, description,
  status, errors)
- Color-coded status (green=success, yellow=warning, gray=no change, blue=empty)
- Mapping details column showing field transformations (e.g., azxs=A0 → azxs=径向)
- Integration with main workflow via optional prompt

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 13:56:00 +08:00
Misaka_Company
613d4436de refactor: rewrite M05_PreProcessor using regex expressions
All checks were successful
NTFY Notification / notify (push) Successful in 12s
Replace character-by-character parsing with regex-based implementation
for value mapping and OR condition merging.

Changes:
- Add ApplyRegexMapping() for regex-based value replacement
  * Uses VBScript.RegExp with Late Binding
  * Replaces from back to front to avoid position shifts
  * Uses regex.Replace() method for precise matching
  * Includes EscapeForRegex() to handle special characters
- Add ProcessNestedExpressions() for recursive parenthesis handling
- Add MergeDuplicateORConditions() for OR deduplication
- Add SimplifyParentheses() for smart parenthesis removal
- Remove ProcessAndSimplifyNested() (150+ lines of complex logic)
- Remove ProcessAndSegment(), ProcessAtom(), ParseAtom()
- Remove MergeDuplicateORs(), MaybeRemoveOuterParentheses()
- Remove JoinCollection(), MergeDuplicateAtoms()

Regex patterns used:
- azxs: (azxs)( *=|!= *)([a-zA-Z0-9]{2})
- lcfw: (lcfw)( *=|!= *)([a-zA-Z]\d{1,3})(?=[ \(\)]?)

Processing flow:
1. Apply azxs value mapping (regex)
2. Apply lcfw value mapping (regex)
3. Process nested expressions (recursive OR merge)
4. Merge top-level OR conditions
5. Simplify unnecessary parentheses

Benefits:
- Code reduced from 647 to 553 lines (-15%)
- Core logic simplified significantly
- Better performance: single regex pass vs multiple string traversals
- Improved readability and maintainability
- Precise replacement using regex.Replace() instead of string Replace()
- Preserved late binding and backward compatibility

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 12:28:41 +08:00
Misaka_Company
3a93459002 feat: add preprocessing module for BOM condition transformation
All checks were successful
NTFY Notification / notify (push) Successful in 5s
Add M05_PreProcessor module to handle value mapping and condition
simplification for "接头" category before parsing.

Features:
- Value mapping: azxs codes (A0/AT/AH→径向, B0/BT/BZ/BH→下轴向,
  Z0/ZT/ZZ/ZH→中轴向) and lcfw ranges (M01-M11→低压, M12-M16→高压)
- OR condition merging: automatically removes duplicate OR segments
- Smart parentheses handling: removes parentheses for single atoms,
  preserves them when needed for logical structure
- Recursive nested expression processing
- Graceful degradation when "对照表" worksheet is missing

Integration:
- Modified M01_Main to initialize preprocessor after M03_Logic
- Preprocessing applied only for "接头" category
- Updated M99_TestRunner with 8 comprehensive test cases
- All tests passing (50 total: 42 core + 8 preprocessing)

Documentation:
- Added detailed flow documentation for Test_PP_06_FullIntegration
  with mermaid diagrams in docs/Test_PP_06_FullIntegration_流程详解.md
- Updated CLAUDE.md with preprocessing module description and
  documentation guidelines (docs/ vs reference_docs/)

Example transformation:
  Input:  gclj=M16 AND (azxs=A0 OR azxs=AT) AND (lcfw=M01 OR lcfw=M15)
  Output: gclj=M16 AND azxs=径向 AND (lcfw=低压 OR lcfw=高压)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 16:24:41 +08:00
Misaka_Company
d6c0fe78a0 docs: add CLAUDE.md with project architecture guidance
All checks were successful
NTFY Notification / notify (push) Successful in 12s
Add comprehensive documentation for Claude Code including:
- VBA module architecture and data flow
- Conditional logic syntax and parsing behavior
- Column mapping and header priority configuration
- Development commands for running converter and tests
- Git workflow and Claude Code integration

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-09 09:02:32 +08:00
Misaka_Company
220c54d1f6 chore: remove test VBA module
All checks were successful
NTFY Notification / notify (push) Successful in 5s
Remove the test module for status bar color demonstration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 13:36:35 +08:00
Misaka_Company
9d8a7633f2 fix: extract repository name from github.repository
All checks were successful
NTFY Notification / notify (push) Successful in 3s
Use github.repository and parse with cut command since
github.repository_name is not available in Gitea Actions.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 13:06:01 +08:00
Misaka_Company
b5011743a9 fix: escape special characters in commit message for NTFY
All checks were successful
NTFY Notification / notify (push) Successful in 6s
Use shell variables to properly handle multi-line commit messages
and special characters that cause shell parsing errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 13:02:05 +08:00
Misaka_Company
880659273e feat: use dynamic repository name in NTFY notification
Some checks failed
NTFY Notification / notify (push) Failing after 3s
- Replace hardcoded 'AutoBOM' with ${{ github.repository_name }}
- Add repository name to tags for better filtering

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 12:54:53 +08:00
Misaka_Company
9a9c988f38 style: improve NTFY notification message formatting
All checks were successful
NTFY Notification / notify (push) Successful in 5s
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 11:21:36 +08:00
Misaka_Company
58e84ddd25 feat: restore VBA source code modules
All checks were successful
NTFY Notification / notify (push) Successful in 4s
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 11:07:36 +08:00
Misaka_Company
25f6ae29ac feat: add NTFY notification workflow for push events
All checks were successful
NTFY Notification / notify (push) Successful in 1m29s
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 10:57:22 +08:00
Misaka_Company
9db957dc37 docs: add platform configuration checklist documentation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 08:31:32 +08:00
Misaka_Company
38581f72d6 chore: clean up documentation and update gitignore
- Add *.xlsx to gitignore to exclude Excel files from version control
- Remove Chinese documentation files that are no longer needed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 13:51:48 +08:00
Misaka_Company
726bbe2118 chore: remove all VBA source files
- Remove all VBA source files from ClassModules, DocumentModules, and Modules
- Remove vba_metadata.json

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 12:26:51 +08:00
Misaka_Company
b412c55654 refactor: update output fields in MainModule
- Add 生产订单号 field from column A of [产品订单] sheet
- Remove 表头型号 field from output
- Reorder columns to place 生产订单号 as first column
- Update ProcessSingleModel and CreateOutputRowArray signatures

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 09:45:28 +08:00
Misaka_Company
8545177bd5 docs: add ComponentInventoryCheckModule flowchart documentation
Add comprehensive flowchart documentation for the component inventory check module:
- Business flowchart (for non-technical users)
- Technical flowchart (for developers)
- Detailed inventory allocation process
- BOM parsing process
- Data processing sequence diagram
- Data structure documentation and execution examples

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 09:32:07 +08:00
Misaka_Company
dd6ae4c005 feat: add component inventory check module
Implement automatic component inventory verification that marks
orders with insufficient stock as "Component Priority = No".

Key features:
- Reads orders from [产品订单] worksheet
- Parses BOM to identify component category materials
- Validates inventory against [现存量] worksheet
- Allocates stock in order sequence
- Handles missing components with warnings instead of errors
- Provides detailed statistics on completion

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 17:55:08 +08:00
Misaka_Company
57adf860ac feat: add additional features (fjgn) support
- Add fjgn (附加功能) field extraction from instrument characteristics
- Extract additional features from model number's instrument feature field
- Merge all fields from index 5 onwards to handle dot separators in features
- Remove oil-fill type (Y+digit) suffix from additional features
- Normalize separators (comma and dot) to comma for consistent parsing
- Implement multi-value matching for fjgn conditions (contains logic)
  - fjgn=N1: true if fjgn contains N1
  - fjgn!=N1: true if fjgn does not contain N1
- Add fjgn to condition config in MainModule and BIPUploadModule

Fixes issue where additional features with dot separators (e.g., N3.N2.Y3)
were incorrectly parsed by merging all fields from index 5 onwards.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 11:04:19 +08:00
Misaka_Company
a22ee42119 chore: remove auto-generated metadata from file headers
- Remove "作者: Auto-generated" and date fields from module headers
- Clean up unnecessary metadata comments

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 10:09:40 +08:00
Misaka_Company
6e45d6bdd2 refactor: standardize variable naming and file formatting
- Rename Quantity to quantity in BomItem for consistent naming convention
- Update references in MainModule to use lowercase quantity
- Add newlines at end of files for consistency
- Update vba_metadata.json with new source path and document module

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 10:01:57 +08:00
Misaka
f3047bccb8 docs: add BIPUploadModule flowchart documentation
Add comprehensive flowchart documentation for BIPUploadModule:
- Simplified main flow diagram for management review
- Detailed ProcessOrdersToBIP flowchart
- ProcessSingleOrder sub-process flowchart
- WriteBatchData batch write flowchart
- Data structure specifications
- Key features and performance optimizations
- Execution examples (normal and error cases)
- Related modules and dependencies

Documentation uses Mermaid diagrams for visualization
with proper bracket escaping for compatibility.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 23:25:04 +08:00
Misaka
d68dc945bc perf: optimize output logic using batch array writes
Optimize BIPUploadModule and MainModule for better performance:
- Replace cell-by-cell writes with batch array operations
- Collect all output data in memory using Collection objects
- Use WriteBatchData to write all data in single operation
- Add CreateBIPRowArray and CreateOutputRowArray helper functions
- Remove deprecated WriteBIPRow and WriteOutputRow functions

Performance improvement:
- Before: N cell write operations per row (thousands of Excel calls)
- After: 1 batch write operation for all data
- Expected speedup: 10-100x depending on data volume

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 23:06:26 +08:00
Misaka
73491c104b fix: clear error messages between BOM extractions
Fix bug where error messages from previous orders were accumulating:
- Add ClearErrorMessages() public method to BomExtractor class
- Initialize pErrorMessages as new collection in ExtractBom()
- Replace commented-out pErrorMessages.Clear with proper initialization
- Ensures each order's error information is independent

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 22:42:00 +08:00
Misaka
c7c12838b2 feat: add component priority support to MainModule
Update MainModule to support component priority field:
- Read component priority from column E of [产品订单] worksheet
- Pass component priority to ProcessSingleModel function
- Apply category exclusion logic based on priority flag:
  - When "否"/"0"/"FALSE", exclude "部件" category
  - Only extract sub-category materials when disabled
- Consistent with BIPUploadModule implementation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 22:35:25 +08:00
Misaka
c5f2d804fb feat: add component priority exclusion feature
Add support for excluding "部件" category based on component priority flag:
- BomExtractor: Add exclude categories functionality
  - Add pExcludeCategories collection member
  - Add SetExcludeCategories() and ClearExcludeCategories() methods
  - Modify DetermineRequiredCategories() to skip excluded categories

- BIPUploadModule: Read and use component priority field
  - Read component priority from column E of [产品订单] worksheet
  - Pass component priority to ProcessSingleOrder()
  - When priority is "否"/"0"/"FALSE", exclude "部件" category
  - Only extract sub-category materials when component priority is disabled

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 22:25:10 +08:00
Misaka
8fae8f0389 feat: add BIP upload module for order processing
Add BIPUploadModule to process product orders and generate BIP upload format:
- Read order data from [产品订单] worksheet
- Extract BOM using existing BomExtractor and ProductModelParser
- Output to [BIP上传模板] with formatted fields:
  - Source document number, product code, quantity
  - Line number (base 7000 + index)
  - Material code (66 code from BOM)
  - Supply method, required date, issue organization
  - Planned outbound quantity, remarks for errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 22:07:36 +08:00
Misaka
79dc7cbf72 feat: add core VBA source code modules
Add VBA directory with essential project code including:
- ClassModules: BomExtractor, BomItem, ConditionEvaluator, ProductModelParser
- Modules: MainModule, TestModule
- Forms and DocumentModules
- vba_metadata.json for module metadata

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 16:18:17 +08:00
Misaka_Company
80d9734b91 clear 2026-01-29 17:08:34 +08:00
Misaka_Company
2b9ba2de9c clear 2026-01-29 17:05:28 +08:00
Misaka_Company
c9cf84ed4d fix: update modules to use new LoadData interface and fix completeness check logic
Changes:
1. Update all modules to use LoadData(wsPlatform) instead of LoadData(wsConfig, wsPlatform)
   - modModelParserExamples.bas: Update 7 example procedures
   - modBOMProcessor.bas: Update 4 procedures
   - modModelParserTest.bas: Update 2 test procedures

2. Fix completeness check logic in GetValidMaterialsByModel
   - Only check root categories to avoid duplicate checking of subcategories
   - Previously, all required categories (including subcategories) were checked,
     causing subcategories to be added to missing list multiple times
   - Now only checks categories with ParentCategoryName = ""
   - CheckCategoryCompleteness already recursively checks all subcategories

3. Improve completeness judgment logic for categories with subcategories
   - Method 1: Parent category has 1 matching material → Complete
   - Method 2: Parent category has 0 matching materials, but all subcategories are complete → Complete
   - Other cases → Incomplete

Impact:
- Fixes "category missing" errors in Example9_BatchProcessOrders_WithCheck
- Eliminates duplicate entries in missing categories list
- Properly handles category hierarchy where parent categories are satisfied through subcategories

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-29 12:38:50 +08:00