抓取生产工单,赚取发料异常

This commit is contained in:
hjq
2026-06-11 15:58:56 +08:00
parent 66eecd0daa
commit 5b19790037
40 changed files with 4942 additions and 54 deletions

View File

@@ -0,0 +1,17 @@
import sys
import json
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent))
from import_to_sqlite import import_abnormal_report_data
from config import OUTPUT_DIR
latest_file = OUTPUT_DIR / "report_abnormal_20260611_120355.json"
print(f"Importing from {latest_file}")
with open(latest_file, 'r', encoding='utf-8') as f:
data = json.load(f)
items = data.get('result', {}).get('items', [])
if items:
count = import_abnormal_report_data(items)
print(f"Imported {count} items.")
else:
print("No items in json.")