from datetime import datetime
import os
from config import Config
import pandas as pd
from back_ground_module import CommonModule
from api import API
from log_config import configure_task_logger, configure_error_task_logger

logger = configure_task_logger()
error_task_logger = configure_error_task_logger()
output_dir = "output"  # 设置输出目录
os.makedirs(output_dir, exist_ok=True)
common_module = CommonModule()
api_instance = API()

# 获取多公司过滤表
payload = {"api_key": "675b900991ad2491c69389ca", "entry_id": "689bf5f8ba88a28cb0679ec9"}
get_filter_company_list = api_instance.entry_data_list(payload).get("data", [])


all_filter_company_list = []
for company in get_filter_company_list:
    company_list = company.get("_widget_1755052002491")
    for company_item in company_list:
        if company_item.get("_widget_1755052002496") == "否":
            all_filter_company_list.append(company_item.get("_widget_1755052002495"))

print("所有过滤公司:", all_filter_company_list)
