|
@@ -1,14 +1,14 @@
|
|
|
from app.api_data.order_util import *
|
|
|
from model.DataBaseUtils import MysqlUtils
|
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
|
-from model.DingTalkUtils import DingTalkUtils,DingTalkDecorators
|
|
|
+from model.DingTalkUtils import DingTalkDecorators
|
|
|
from app.api_data.platform_order.audio_qiyue import AudioQiyue
|
|
|
from app.api_data.platform_order.youshuge import get_youshuge_order_task
|
|
|
from app.api_data.platform_order.yuewen import get_yuewen_order_task
|
|
|
+from app.api_data.platform_order.yangguang import yangguang
|
|
|
|
|
|
db = MysqlUtils()
|
|
|
|
|
|
-
|
|
|
def get_account(plactform, id=None):
|
|
|
op = f" and id={id} " if id else ''
|
|
|
data = db.quchen_text.getData(f"select text from order_account_text where platform='{plactform}' {op}")
|
|
@@ -27,45 +27,6 @@ def get_new_account(plactform):
|
|
|
return new_data
|
|
|
|
|
|
|
|
|
-@DingTalkDecorators("阳光")
|
|
|
-def yangguang(start=None, end=None, new=None):
|
|
|
- if start:
|
|
|
- start = start + ' 00:00:00'
|
|
|
- end = end + ' 23:59:59'
|
|
|
- else:
|
|
|
- start = du.getTodayOrYestoday() + ' 00:00:00'
|
|
|
- end = du.get_n_hours_ago(0)
|
|
|
-
|
|
|
- client_id = 10008097
|
|
|
- token = '2xa1d55tTPBjeEA8Ho'
|
|
|
- accounts = get_account("阳光") if new is None else get_new_account('阳光')
|
|
|
- if accounts.__len__() == 0:
|
|
|
- return
|
|
|
- else:
|
|
|
- print(f"阳光账号数:{accounts.__len__()}")
|
|
|
-
|
|
|
- for i in accounts:
|
|
|
- stage = i[0]
|
|
|
- vip_id = i[1]
|
|
|
- print(vip_id)
|
|
|
- get_yg_vip_channel(stage, vip_id, client_id, token)
|
|
|
- get_yg_data(stage, vip_id, client_id, token, start, end)
|
|
|
- x = 1
|
|
|
- while True:
|
|
|
- a = db.quchen_text.getOne("select count(1) from yangguang_path where update_time is null")
|
|
|
- print(f" vip 待处理数量 {a} 正在等待数据回调")
|
|
|
- if a == 0:
|
|
|
- break
|
|
|
- time.sleep(60)
|
|
|
- x += 1
|
|
|
- if x > 20:
|
|
|
- DingTalkUtils.send('阳光订单回调延时20min', '18860455786')
|
|
|
- break
|
|
|
-
|
|
|
- for i in accounts:
|
|
|
- vip_id = i[1]
|
|
|
- stage = i[0]
|
|
|
- parse_yg_data(vip_id, stage)
|
|
|
|
|
|
|
|
|
@DingTalkDecorators("花生")
|
|
@@ -188,11 +149,6 @@ def youshuge(start=None, end=None):
|
|
|
executor.shutdown()
|
|
|
|
|
|
def hourly():
|
|
|
- # try:
|
|
|
- # yangguang()
|
|
|
- # except:
|
|
|
- # pass
|
|
|
-
|
|
|
huasheng()
|
|
|
qiyue()
|
|
|
qiyueyousheng()
|
|
@@ -201,15 +157,12 @@ def hourly():
|
|
|
zhangzhongyun()
|
|
|
yueweng()
|
|
|
youshuge()
|
|
|
+ yangguang()
|
|
|
|
|
|
|
|
|
def daily():
|
|
|
st = du.get_n_days(-10)
|
|
|
et = du.get_n_days(-1)
|
|
|
- # try:
|
|
|
- # yangguang(st, et)
|
|
|
- # except:
|
|
|
- # pass
|
|
|
huasheng(st, et)
|
|
|
qiyue(st, et)
|
|
|
qiyueyousheng(st, et)
|
|
@@ -218,33 +171,9 @@ def daily():
|
|
|
zhangzhongyun(st, et)
|
|
|
yueweng(st, et)
|
|
|
youshuge(st, et)
|
|
|
-
|
|
|
-
|
|
|
-def daily_yg():
|
|
|
- st = du.get_n_days(-10)
|
|
|
- et = du.get_n_days(-1)
|
|
|
- try:
|
|
|
- yangguang(st, et)
|
|
|
- except:
|
|
|
- pass
|
|
|
+ yangguang(st, et)
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- # a=time.time()
|
|
|
- # yangguang()
|
|
|
- # print(time.time()-a)
|
|
|
- # huasheng('2021-02-24','2021-02-24')
|
|
|
- # qiyue()
|
|
|
- # wending()
|
|
|
-
|
|
|
- # zhangdu('2020-11-01', '2020-12-20')
|
|
|
-
|
|
|
- # zhangzhongyun('2021-04-01', '2021-04-21')
|
|
|
- # youshuge()
|
|
|
- # yueweng()
|
|
|
- # huasheng()
|
|
|
- # qiyue()
|
|
|
- # qiyueyousheng()
|
|
|
- # wending()
|
|
|
- # zhangdu()
|
|
|
- zhangzhongyun()
|
|
|
+ # zhangzhongyun()
|
|
|
+ yangguang()
|