|
@@ -21,10 +21,10 @@ class AppBytedanceVideoReportBusi:
|
|
|
|
|
|
def taskHandler(self):
|
|
def taskHandler(self):
|
|
try:
|
|
try:
|
|
- sql_porject = """select project_id from `jeecg-boot`.ctop_user_allocation where media_id=1
|
|
|
|
-group by project_id """
|
|
|
|
- project_list = TidbConn.quary(self.conn,sql_porject)
|
|
|
|
- for project_id in project_list:
|
|
|
|
|
|
+ sql_porject = """select account_id from `jeecg-boot`.ctop_user_allocation where media_id=1
|
|
|
|
+group by account_id """
|
|
|
|
+ account_list = TidbConn.quary(self.conn, sql_porject)
|
|
|
|
+ for account_id in account_list:
|
|
try:
|
|
try:
|
|
sql = """SET sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
|
|
sql = """SET sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
|
|
REPLACE INTO application.app_bytedance_video_report_busi_{day_count}d
|
|
REPLACE INTO application.app_bytedance_video_report_busi_{day_count}d
|
|
@@ -647,13 +647,14 @@ FROM (
|
|
date_sub({date_time}, INTERVAL ({day_count} -1 ) DAY),
|
|
date_sub({date_time}, INTERVAL ({day_count} -1 ) DAY),
|
|
'%Y%m%d'
|
|
'%Y%m%d'
|
|
)
|
|
)
|
|
|
|
+ and advertiser_id={account_id}
|
|
GROUP BY advertiser_id,
|
|
GROUP BY advertiser_id,
|
|
material_id,
|
|
material_id,
|
|
image_mode,
|
|
image_mode,
|
|
inventory
|
|
inventory
|
|
) report
|
|
) report
|
|
LEFT JOIN (select advertiser_id, signature, material_id, filename, video_url
|
|
LEFT JOIN (select advertiser_id, signature, material_id, filename, video_url
|
|
- from `media_api`.bytedance_file_video_get
|
|
|
|
|
|
+ from `media_api`.bytedance_file_video_get and advertiser_id={account_id}
|
|
group by advertiser_id, signature, material_id, filename, video_url) video
|
|
group by advertiser_id, signature, material_id, filename, video_url) video
|
|
ON report.account_id = video.advertiser_id AND report.material_id = video.material_id
|
|
ON report.account_id = video.advertiser_id AND report.material_id = video.material_id
|
|
LEFT JOIN `jeecg-boot`.ctop_material_info cmi ON video.signature = cmi.code
|
|
LEFT JOIN `jeecg-boot`.ctop_material_info cmi ON video.signature = cmi.code
|
|
@@ -678,9 +679,10 @@ FROM (
|
|
LEFT JOIN `jeecg-boot`.sys_user shot ON shot.id = cma.shot_id
|
|
LEFT JOIN `jeecg-boot`.sys_user shot ON shot.id = cma.shot_id
|
|
LEFT JOIN `jeecg-boot`.sys_user plan ON plan.id = cma.plan_id
|
|
LEFT JOIN `jeecg-boot`.sys_user plan ON plan.id = cma.plan_id
|
|
LEFT JOIN `jeecg-boot`.sys_user leader ON leader.id = cma.leader_id
|
|
LEFT JOIN `jeecg-boot`.sys_user leader ON leader.id = cma.leader_id
|
|
- LEFT JOIN `jeecg-boot`.user_company up ON up.user_id = cma.clip_id;""".format(date_time=self.date_time,
|
|
|
|
- day_count=self.day_count,
|
|
|
|
- project_id=project_id[0])
|
|
|
|
|
|
+ LEFT JOIN `jeecg-boot`.user_company up ON up.user_id = cma.clip_id
|
|
|
|
+ where cua.account_id = {account_id};""".format(date_time=self.date_time,
|
|
|
|
+ day_count=self.day_count,
|
|
|
|
+ account_id=account_id[0])
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
self.conn.commit()
|
|
self.conn.commit()
|
|
except Exception as e:
|
|
except Exception as e:
|