feishu_form.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # -*- coding: utf-8 -*-
  2. import json
  3. import os
  4. import sys
  5. sys.path.append(os.getcwd())
  6. from common.feishu_utils import Feishu
  7. class Material():
  8. """
  9. 获取品类对应负责人任务明细
  10. """
  11. @classmethod
  12. def get_carry_data(cls, dt, FS_SHEET, NAME):
  13. data = Feishu.get_values_batch( "NFHPswCE7haebJt2m4rcBnuUnUc", FS_SHEET )
  14. processed_list = []
  15. try:
  16. for row in data[2:]:
  17. activate_data = row[5] # 启动日期
  18. if not activate_data:
  19. continue
  20. if int(activate_data) != int(dt):
  21. continue
  22. channel_mark = row[0]
  23. pq_ids = row[1]
  24. pq_label = row[2] # 站内标签
  25. video_id = row[3] # 站内账号id
  26. title = row[4] #标题类别
  27. number_dict = {
  28. "channel_mark": channel_mark,
  29. "name":NAME,
  30. "pq_ids": pq_ids,
  31. "pq_label": pq_label,
  32. "activate_data": activate_data,
  33. "video_id": video_id,
  34. "title": title,
  35. "dt":dt
  36. }
  37. processed_list.append(json.dumps(number_dict, ensure_ascii=False))
  38. return processed_list
  39. except:
  40. return processed_list