|
@@ -3,6 +3,8 @@ from model.DataBaseUtils import MysqlUtils
|
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
|
from model.DingTalkUtils import DingTalkUtils
|
|
|
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
|
|
|
|
|
|
db = MysqlUtils()
|
|
|
|
|
@@ -81,7 +83,7 @@ def huasheng(start=None, end=None, new=None):
|
|
|
if not channel_data:
|
|
|
continue
|
|
|
else:
|
|
|
- print(f"账号:{account[2]} 有channel{len(channel_data)}个")
|
|
|
+ print(f"花生账号:{account[2]} 有channel{len(channel_data)}个")
|
|
|
for merchant in channel_data:
|
|
|
executor.submit(get_huasheng_order_task, start, end, account, merchant, li)
|
|
|
executor.shutdown(True)
|
|
@@ -128,7 +130,8 @@ def zhangdu(start=None, end=None, new=None):
|
|
|
|
|
|
def zhangzhongyun(start=None, end=None, new=None):
|
|
|
if start is None:
|
|
|
- start = end = du.getNow()
|
|
|
+ start = du.getNow()
|
|
|
+ end = du.get_n_days(1)
|
|
|
|
|
|
executor = ThreadPoolExecutor(max_workers=5)
|
|
|
accounts = get_account("掌中云") if new is None else get_new_account('掌中云')
|
|
@@ -141,25 +144,25 @@ def zhangzhongyun(start=None, end=None, new=None):
|
|
|
executor.shutdown()
|
|
|
|
|
|
|
|
|
-def yueweng(start=None, end=None, new=None):
|
|
|
+def yueweng(start=None, end=None):
|
|
|
if start is None:
|
|
|
start = end = du.getNow()
|
|
|
|
|
|
executor = ThreadPoolExecutor(max_workers=5)
|
|
|
- accounts = get_account("阅文") if new is None else get_new_account('阅文')
|
|
|
+ accounts = get_account("阅文")
|
|
|
if len(accounts) == 0:
|
|
|
return
|
|
|
else:
|
|
|
print(f'阅文有账号{len(accounts)}个')
|
|
|
for account in accounts:
|
|
|
- executor.submit(get_yueweng_order_task, start, end, account)
|
|
|
+ executor.submit(get_yuewen_order_task, start, end, account)
|
|
|
executor.shutdown()
|
|
|
|
|
|
|
|
|
-def qiyueyousheng(start=None, end=None, new=None):
|
|
|
+def qiyueyousheng(start=None, end=None):
|
|
|
if start is None:
|
|
|
start = end = du.getNow()
|
|
|
- accounts = get_account("七悦有声") if new is None else get_new_account('七悦有声')
|
|
|
+ accounts = get_account("七悦有声")
|
|
|
if len(accounts) == 0:
|
|
|
return
|
|
|
else:
|
|
@@ -168,20 +171,34 @@ def qiyueyousheng(start=None, end=None, new=None):
|
|
|
AudioQiyue().get_order(start, end, account)
|
|
|
|
|
|
|
|
|
+def youshuge(start=None, end=None):
|
|
|
+ if start is None:
|
|
|
+ start = end = du.getNow()
|
|
|
+
|
|
|
+ executor = ThreadPoolExecutor(max_workers=5)
|
|
|
+ accounts = get_account("悠书阁")
|
|
|
+ if len(accounts) == 0:
|
|
|
+ return
|
|
|
+ else:
|
|
|
+ print(f'悠书阁有账号{len(accounts)}个')
|
|
|
+ for account in accounts:
|
|
|
+ executor.submit(get_youshuge_order_task, start, end, account)
|
|
|
+ executor.shutdown()
|
|
|
+
|
|
|
def hourly():
|
|
|
# try:
|
|
|
# yangguang()
|
|
|
# except:
|
|
|
# pass
|
|
|
- st = du.get_n_days(0)
|
|
|
- et = du.get_n_days(1)
|
|
|
|
|
|
huasheng()
|
|
|
qiyue()
|
|
|
qiyueyousheng()
|
|
|
wending()
|
|
|
zhangdu()
|
|
|
- zhangzhongyun(st, et)
|
|
|
+ zhangzhongyun()
|
|
|
+ yueweng()
|
|
|
+ youshuge()
|
|
|
|
|
|
|
|
|
def daily():
|
|
@@ -218,4 +235,6 @@ if __name__ == '__main__':
|
|
|
|
|
|
# zhangdu('2020-11-01', '2020-12-20')
|
|
|
|
|
|
- zhangzhongyun('2021-04-01', '2021-04-21')
|
|
|
+ # zhangzhongyun('2021-04-01', '2021-04-21')
|
|
|
+ # youshuge()
|
|
|
+ yueweng()
|