Commit Graph

12 Commits

Author SHA1 Message Date
Misaka_Company
1addb55df1 fix: auto-save report after clean() completes in GUI and CLI
- Add save_report parameter to DiscreteMaterialPlanCleaner (default True)
- Auto-save report at end of clean() method when save_report_enabled
- Remove explicit save_report() call from main() (now automatic)
- Pass save_report=True in GUI _delete_worker()

This ensures reports are saved for both GUI and CLI execution paths.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-27 17:21:29 +08:00
Misaka_Company
4a17c8fd11 refactor: change error report format from table to code blocks
Display error messages as separate sections with code blocks instead of
table rows. This improves readability for long error messages that would
overflow in table cells.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-27 14:15:29 +08:00
Misaka
3b7c00377f style: format all Python files with Black
Apply Black formatter to the entire codebase for consistent code style.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-26 22:44:03 +08:00
Misaka_Company
2a784e66c0 feat: add unmatched materials section to execution report
Track materials that are not in the delete list and display them in
a new "未处理物料" (Unmatched Materials) section in the report.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-26 14:52:58 +08:00
Misaka_Company
784007c8d4 fix: ensure page2 is closed even on exception in process_single_order
Wrap the order processing logic in try-finally to guarantee cleanup
of the popup page regardless of whether processing succeeds or fails.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-26 14:19:56 +08:00
Misaka_Company
8d51c5b368 feat: add delete execution feature with progress tracking and dryrun mode
- Add ExecutionConfig for dryrun settings in config schema
- Create DeleteProgressWindow widget for real-time progress display
- Integrate delete execution flow in MaterialValidationTab with threading
- Add dryrun checkbox for admin users in settings
- Add progress callback support to DiscreteMaterialPlanCleaner
- Add markdown report generation with statistics
- Include tkinterweb and markdown2 dependencies for report rendering

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-26 13:02:48 +08:00
Misaka_Company
63601a994f feat: add dryrun parameter to skip save operations
Add dryrun boolean parameter to DiscreteMaterialPlanCleaner.
When dryrun=True, the save_button_locator.click() is skipped,
allowing preview of changes without actually saving.

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-26 10:09:05 +08:00
Misaka_Company
167fa2893f feat: support multiple managers in DiscreteMaterialPlanCleaner
- Add get_materials_to_delete_by_managers() function in db/materials_to_delete.py
  - Supports querying by single manager, multiple managers, or all managers
  - Uses IN clause for multi-manager queries
- Refactor DiscreteMaterialPlanCleaner to accept manager_names parameter
  - Accepts str, List[str], or None (for all managers)
  - Automatically normalizes parameter types in __init__
  - Updates preload_data() with appropriate log messages

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-26 10:01:48 +08:00
Misaka
c5f48eb7c8 style: format code in discrete material cleaner
Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-02-25 22:38:36 +08:00
Misaka_Company
0a2c3c55c6 feat: add wait mechanisms for delete and save operations in discrete material cleaner
This change adds robust wait mechanisms to prevent race conditions when
performing delete and save operations in the ERP system.

Changes:
- Add row number change detection after delete to confirm completion
- Add save button disappearance detection to confirm save completion
- Add row number range check (7000-8000) to skip specific rows
- Enable previously commented save button click
- Improve logging with detailed status messages
- Add timeout handling (10s for delete, 60s for save)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-25 11:45:31 +08:00
Misaka
de25841364 style: apply code formatting to discrete_material_plan_cleaner.py
Apply consistent code formatting including:
- Single quotes to double quotes for string literals
- Multi-line formatting for long expressions
- Trailing whitespace cleanup
- Blank line adjustments for PEP 8 compliance

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-24 22:23:34 +08:00
Misaka_Company
19dfe5b09e refactor: rename Chinese-named Python files to English
Rename utility files to use English names for better cross-platform compatibility:
- utils/离散备料计划维护数据提取.py → utils/discrete_material_plan_extractor.py
- utils/离散备料计划维护数据清理.py → utils/discrete_material_plan_cleaner.py

Update all import statements across the codebase and documentation references.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-24 17:35:23 +08:00