
import requests
import json

r = requests.get('http://localhost:7892/api/live-status')
data = r.json()

print('='*80)
print('  🔍 任务状态监控')
print('='*80)

for t in data.get('tasks', []):
    if t.get('id', '').startswith('JJC-20260401'):
        print(f'\n任务ID: {t.get("id")}')
        print(f'标题: {t.get("title")}')
        print(f'状态: {t.get("state")}')
        print(f'当前: {t.get("now")}')
        print(f'组织: {t.get("org")}')

        flow_log = t.get('flow_log', [])
        if flow_log:
            print('最新流程:')
            last = flow_log[-1]
            print(f'  时间: {last.get("at")}')
            print(f'  从: {last.get("from")}')
            print(f'  到: {last.get("to")}')
            print(f'  备注: {last.get("remark")}')

