## 上一个月核对,补数据脚本
import get_order_dairly_yangguang
import get_order_dairly_wending
import get_order_dairly_qiyue

from util import platform_order_api_util

from util import platform_config_util
from util import date_util

from util import db_order_util
from util import platform_config_util


def get_order_job(st_unix,et_unix):
    print('查询开始时间：', st_unix, date_util.getSecondsToDatetime(st_unix))
    print('查询结束时间：', et_unix, date_util.getSecondsToDatetime(et_unix))

    ## 直接读取所有账号
    #account_list_yuewen = platform_config_util.get_yuewen_account_list()
    #account_list_zhangzhongyun = platform_config_util.get_zhangzhongyun_account_list()
    #account_list_huasheng = platform_config_util.get_huasheng_account_list()
    #account_list_youshuge = platform_config_util.get_youshuge_account_list()
    #account_list_zhangdu = platform_config_util.get_zhangdu_account_list()

    #account_list_wending = platform_config_util.get_wending_account_list()
    #account_list_yangguang = platform_config_util.get_yangguang_account_list()
    #account_list_qiyue =  platform_config_util.get_qiyue_account_list()
    

    ## 数据缺失账户读取
    #account_list_yuewen = platform_config_util.get_account_list('阅文', 'new_account/new_yuewen.csv') 
    #account_list_zhangzhongyun = platform_config_util.get_account_list('掌中云', 'new_account/new_zhangzhongyun.csv')
    #account_list_huasheng = platform_config_util.get_account_list('花生', 'new_account/new_huasheng.csv') 
    #account_list_youshuge = platform_config_util.get_account_list('悠书阁', 'new_account/new_youshuge.csv')
    account_list_zhangdu = platform_config_util.get_account_list('掌读', 'new_account/new_zhangdu.csv') 

    #account_list_wending = platform_config_util.get_account_list('文鼎', 'new_account/new_wending.csv') 
    #account_list_yangguang = platform_config_util.get_account_list('阳光', 'new_account/new_yangguang.csv')
    #account_list_qiyue =  platform_config_util.get_account_list('七悦', 'new_account/new_qiyue.csv')
    ##


    #db_order_util.batch_save_order(platform_order_api_util.get_zhangzhongyun_order(st_unix, et_unix,account_list_zhangzhongyun))
    #db_order_util.batch_save_order(platform_order_api_util.get_yuewen_order(st_unix, et_unix,account_list_yuewen))
    #db_order_util.batch_save_order(platform_order_api_util.get_huasheng_order(st_unix, et_unix,account_list_huasheng))
    #db_order_util.batch_save_order(platform_order_api_util.get_youshuge_order(st_unix, et_unix,account_list_youshuge))
    db_order_util.batch_save_order(platform_order_api_util.get_zhangdu_order(st_unix, et_unix,account_list_zhangdu))

    #db_order_util.batch_save_order(get_order_dairly_wending.get_wending_order(st_unix, et_unix,account_list_wending))
    #db_order_util.batch_save_order(get_order_dairly_yangguang.get_yangguang_order(st_unix, et_unix,account_list_yangguang))  
    #db_order_util.batch_save_order(get_order_dairly_qiyue.get_qiyue_order(st_unix, et_unix,account_list_qiyue))


if __name__ == "__main__":
    #st_unix = 1582992000  # 2020/03/01 00:00:00
    st_unix = 1604160000  # 2020/11/01 00:00:00
    et_unix = 1606060800  # 2020/11/23 02:00:00  
    get_order_job(st_unix,et_unix)



