123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- from model.DateUtils import DateUtils
- from data_stat_task import *
- from sync_to_ck_task import *
- du = DateUtils()
- from model.DingTalkUtils import DingTalkUtils
- yestoday = du.get_n_days(-1)
- today = du.get_n_days(0)
- def run(ymd):
- try:
- # 公众号元数据
- channel_by_account_daily(ymd)
- channel_info_daily(ymd)
- # 清洗订单表-同步到ck
- ods_order(ymd)
- order_sync_ck(ymd)
- # 公众号维度数据-同步到ck
- dw_daily_channel_cost(ymd)
- dw_order_channel_cost_sync_ck(ymd)
- dw_channel_daily_total(ymd)
- except Exception as e:
- DingTalkUtils.send("数据ETL出错:",'18860455786')
- def run_order_history():
- """当order表跑了历史的数据,要从这历史数据的最早时间跑此任务流"""
- for i in du.getDateLists('2020-11-01',du.get_n_days(0)):
- print(i)
- ods_order(i)
- order_sync_ck(i)
- dw_channel_daily_total(i)
- dw_daily_channel()
- print('ok')
- def run_cost_history():
- "cost 重跑后,跑此任务流"
- for i in du.getDateLists('2020-11-01',du.get_n_days(0)):
- print(i)
- dw_daily_channel_cost(i)
- dw_order_channel_cost_sync_ck(i)
- dw_channel_daily_total(i)
- dw_daily_channel()
- def main():
- run(yestoday)
- dw_daily_channel()
- dm_pitcher_daily_page_total()
- if __name__ == '__main__':
- # main()
- run_order_history()
|