- Add ProgressInfo and ProgressCalculator classes for structured progress tracking
- Implement RealtimeOutput for immediate log display without buffering
- Add progress callback support to DiscreteMaterialPlanExtractor
- Use queue-based thread-safe communication for GUI progress updates
- Fix log output issue where all content appeared at once after completion
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add batch processing to production order query to handle SQL Server's 2100 parameter limit
- Fix material name column index from Q to R column
- Add string type conversion to prevent TypeError in material matching
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add MaterialStatusValidator tool to check material status and match materials to be deleted:
- Add get_all_materials_to_delete() function to fetch all materials from database
- Add utils/material_status_validator.py with MaterialStatusValidator class
- Add validate_material_status.py script to run the validation
- Delete obsolete materialDelete.py file
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed footer detection to look ahead at the next row instead of the current row, and simplified to only check for '制单人'.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add db/materials_to_delete.py for querying materials to delete by manager
- Add manager_name parameter to DiscreteMaterialPlanCleaner
- Implement material keyword matching logic in process_order
- Update file paths from orderID.txt to ProductionID.txt
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add db/production_order_query.py component for querying production orders
- Replace file-based orderID.txt with database-driven approach
- Read ProductionID.txt (总排号) and query [26年压力表合同数据] table
- Update both extraction and cleaning scripts to use new component
- Change parameter: order_id_file → production_id_file
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace the class-based locator strategy with a text-based filter using regex to accurately identify the material code input field. This change targets elements matching "材料编码" followed by 11 digits, increasing reliability. Also uncommented page2.pause() to assist with debugging the iteration loop.
Refine element selection by introducing a specific parent container `.card-table-side-box` to enhance locator accuracy. Replace the previous text-parsing approach for material codes with direct input value retrieval. Additionally, add support for extracting cumulative pending and outbound quantities to improve data completeness.
Added logic to extract and validate the "Material Preparation Status" (备料状态) before modifying discrete material plans.
The cleanup process now only proceeds if the status is "审批通过" (Approval Passed). Orders with other statuses are skipped to prevent errors during modification. This change also includes code cleanup by removing commented-out debug statements.
Remove manual exit prompt in main script to allow automated execution.
Add logic in DiscreteMaterialPlanCleaner to navigate the "Material Plan" popup, handling nested iframes and waiting for data to load. Implement iteration over material details to extract codes and names, handling cases where no details exist.
Implement a new automation script and utility to handle the cleaning of
discrete material plan maintenance data.
- Add main_clean.py as the primary entry point, configuring the cleaner
instance and reading order IDs.
- Add DiscreteMaterialPlanCleaner in utils/ utilizing Playwright to automate
browser interactions.
- Implement logic for user authentication (login/logout), UI setup for
queries, and processing individual orders.
- Include verbose logging and debug mode support for troubleshooting.