1 parent
1f8797987d
commit
ac27310dfd
1 file changed
+7
-1
+7
-1
@@ -63,6 +63,7 @@ def get_all_work_orders(page_size: int = 20, status: str = "new") -> List:
|
||||
)
|
||||
|
||||
data = res.get("data", {})
|
||||
print(data)
|
||||
pages = res.get("page", {}).get("pages", 0)
|
||||
|
||||
if not data:
|
||||
@@ -72,6 +73,7 @@ def get_all_work_orders(page_size: int = 20, status: str = "new") -> List:
|
||||
if page >= pages:
|
||||
break
|
||||
page += 1
|
||||
# print(all_orders)
|
||||
|
||||
return all_orders
|
||||
|
||||
@@ -190,9 +192,12 @@ def main():
|
||||
try:
|
||||
# 获取所有工单
|
||||
work_orders = get_all_work_orders()
|
||||
if not work_orders:
|
||||
print("未找到工单")
|
||||
|
||||
# 处理每个工单
|
||||
print(f"共找到 {len(work_orders)} 个工单")
|
||||
|
||||
for order in work_orders:
|
||||
processed_order = process_work_order(order)
|
||||
|
||||
@@ -226,7 +231,8 @@ def main():
|
||||
# break
|
||||
messages = "\n".join(messages)
|
||||
if messages.strip():
|
||||
feishu_notify()
|
||||
print("发送飞书通知")
|
||||
feishu_notify(text=messages)
|
||||
|
||||
except requests.RequestException as e:
|
||||
print(f"请求发生错误: {e}")
|
||||
|
||||
Reference in new issue
Block a user