|
@@ -158,6 +158,103 @@ class Material():
|
|
|
processed_list = cls.sort_keyword_data(processed_list)
|
|
|
return processed_list
|
|
|
|
|
|
+ """
|
|
|
+ 获取品类对应负责人任务明细
|
|
|
+ """
|
|
|
+ @classmethod
|
|
|
+ def get_pl_task_data(cls, feishu_id, feishu_sheet):
|
|
|
+ data = Feishu.get_values_batch( feishu_id, feishu_sheet )
|
|
|
+ processed_list = []
|
|
|
+ try:
|
|
|
+ for row in data[1:]:
|
|
|
+ channel_id = row[1]
|
|
|
+ channel_url = str( row[2] )
|
|
|
+ piaoquan_id = row[3]
|
|
|
+ number = row[4]
|
|
|
+ video_share = row[5]
|
|
|
+ video_ending = row[6]
|
|
|
+ voice = row[7]
|
|
|
+ crop_tool = row[8]
|
|
|
+ gg_duration = row[9]
|
|
|
+ title = row[10]
|
|
|
+ if channel_url == None or channel_url == "" or len( channel_url ) == 0:
|
|
|
+ continue
|
|
|
+ try:
|
|
|
+ ls_number = int( row[11] )
|
|
|
+ except:
|
|
|
+ ls_number = None
|
|
|
+ first_category = row[12]
|
|
|
+
|
|
|
+ def count_items(item, separator):
|
|
|
+ if item and item not in {'None', ''}:
|
|
|
+ return len( item.split( separator ) )
|
|
|
+ return 0
|
|
|
+
|
|
|
+ video_id_total = count_items( str( channel_url ), ',' )
|
|
|
+ title_total = count_items( str( title ), '/' )
|
|
|
+ video_ending_total = count_items( str( video_ending ), ',' )
|
|
|
+ values = [channel_id, video_id_total, piaoquan_id, video_share, video_ending_total, crop_tool,
|
|
|
+ gg_duration, title_total]
|
|
|
+ filtered_values = [str( value ) for value in values if value is not None and value != "None"]
|
|
|
+ task_mark = "_".join( map( str, filtered_values ) )
|
|
|
+ if piaoquan_id and piaoquan_id not in {'None', ''}:
|
|
|
+ if ',' in channel_url:
|
|
|
+ channel_url = channel_url.split( ',' )
|
|
|
+ else:
|
|
|
+ channel_url = [channel_url]
|
|
|
+ for user in channel_url:
|
|
|
+ number_dict = {
|
|
|
+ "task_mark": task_mark,
|
|
|
+ "channel_id": channel_id,
|
|
|
+ "channel_url": user,
|
|
|
+ "piaoquan_id": piaoquan_id,
|
|
|
+ "number": number,
|
|
|
+ "title": title,
|
|
|
+ "video_share": video_share,
|
|
|
+ "video_ending": video_ending,
|
|
|
+ "crop_total": crop_tool,
|
|
|
+ "gg_duration_total": gg_duration,
|
|
|
+ "voice": voice,
|
|
|
+ "first_category": first_category, # 一级品类
|
|
|
+ }
|
|
|
+ processed_list.append( json.dumps( number_dict, ensure_ascii=False ) )
|
|
|
+ if channel_id == "抖音" or channel_id == "快手" or channel_id == "视频号":
|
|
|
+ if ls_number and ls_number not in {'None', ''}:
|
|
|
+ if channel_id == "抖音":
|
|
|
+ new_channel_id = "抖音历史"
|
|
|
+ if channel_id == "快手":
|
|
|
+ new_channel_id = "快手历史"
|
|
|
+ if channel_id == "视频号":
|
|
|
+ new_channel_id = "视频号历史"
|
|
|
+
|
|
|
+ values1 = [new_channel_id, video_id_total, piaoquan_id, video_share, video_ending_total,
|
|
|
+ crop_tool,
|
|
|
+ gg_duration, title_total]
|
|
|
+ filtered_values1 = [str( value ) for value in values1 if
|
|
|
+ value is not None and value != "None"]
|
|
|
+ task_mark1 = "_".join( map( str, filtered_values1 ) )
|
|
|
+ number_dict = {
|
|
|
+ "task_mark": task_mark1,
|
|
|
+ "channel_id": new_channel_id,
|
|
|
+ "channel_url": user,
|
|
|
+ "piaoquan_id": piaoquan_id,
|
|
|
+ "number": ls_number,
|
|
|
+ "title": title,
|
|
|
+ "video_share": video_share,
|
|
|
+ "video_ending": video_ending,
|
|
|
+ "crop_total": crop_tool,
|
|
|
+ "gg_duration_total": gg_duration,
|
|
|
+ "voice": voice,
|
|
|
+ "first_category": first_category, # 一级品类
|
|
|
+ }
|
|
|
+ processed_list.append( json.dumps( number_dict, ensure_ascii=False ) )
|
|
|
+ else:
|
|
|
+ return processed_list
|
|
|
+
|
|
|
+ return processed_list
|
|
|
+ except:
|
|
|
+ return processed_list
|
|
|
+
|
|
|
"""
|
|
|
获取对应负责人任务明细
|
|
|
"""
|