12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- from model.DateUtils import DateUtils
- import logging
- from model.DingTalkUtils import DingTalkUtils
- from data_stat_task import *
- from sync_to_ck_task import *
- from app.etl.dm.dm_pitcher_daily_overview import dm_pitcher_daily_overview
- from app.etl.dw.dw_channel_daily import dw_daily_channel,dw_channel
- from app.etl.dw.dw_pitcher_daily import dw_pitcher_trend
- from app.etl.src.src_book_info import src_book_info
- from app.etl.dw.dw_book_trend import book_trend
- from app.etl.src import book_annual_expect_profit
- du = DateUtils()
- logger = logging.getLogger("")
- # logger.setLevel(logging.ERROR)
- logging.getLogger().setLevel(logging.WARNING)
- def do_order(st,et):
- for i in du.getDateLists(st,et):
- print(i)
- ods_order(i)
- order_sync_ck(i)
- def do_cost(st,et):
- for i in du.getDateLists(st,et):
- print(i)
- channel_by_account_daily(i)
- channel_info_daily(i)
- dw_daily_channel_cost(i)
- def main(st,et):
- try:
- do_order(st,et)
- do_cost(st,et)
- src_book_info() # 书籍卡点信息
- book_annual_expect_profit.run()
- dw_daily_channel()
- dw_channel()
- dw_pitcher_trend()
- book_trend()
- dm_pitcher_daily_overview()
- except Exception as e:
- print(e)
- DingTalkUtils.send("hourlyRun fail!! "+str(e),'18860455786')
- def hourly():
- thedate=du.getTodayOrYestoday()
- main(thedate, thedate)
- def daily():
- "往前跑10天"
- st=du.get_n_days(-10)
- et=du.get_n_days(-1)
- do_order(st, et)
- do_cost(st, et)
-
- if __name__ == '__main__':
- # hourly()
- do_cost('2021-02-10','2021-02-10')
- # do_order('2021-02-10','2021-02-23')
|