Files
37duAutomation/_tmp_full_flow_test.py
T
puddy 54e2fef25d feat: 新增社保告知书制作下发全流程模块
1. 新增参保/停保告知书生成模块,支持按模板批量生成Word+PDF
2. 新增社保转移告知书独立数据源处理逻辑
3. 新增OA工作沟通推送数据自动构造能力
4. 重构雇主险模块,拆分变更清单导出为独立文件
5. 新增花名册查询工具模块,支持店长/人事批量查询
6. 更新项目文档与README说明
2026-08-26 19:50:32 +08:00

42 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""临时:全流程测试 —— 生成告知书 -> 构造工作沟通数据 -> 推送 OA(临时接收人 37036361 夏一平)。"""
import json
import sys
sys.path.insert(0, r"d:\work\code\37duAutomation")
from yingdao.notice.notice_mail_merge import build_work_communication_data, generate_notices
from yingdao.oa.work_communication import send_work_communication
TEST_RECEIVER = ["37036361"] # 测试接收人:37036361 夏一平
TEST_RECEIVER = ["37036361", "37001166"] # 测试接收人(多人):37036361 夏一平 + 37001166
if __name__ == "__main__":
# STEP1 生成告知书(docx + pdf)
print("== STEP1 生成告知书 ==", flush=True)
results = generate_notices()
print("STEP1 完成:", {k: len(v) for k, v in results.items()}, flush=True)
# STEP2 构造工作沟通数据
print("== STEP2 构造工作沟通数据 ==", flush=True)
messages = build_work_communication_data()
print("STEP2 完成,共", len(messages), "条", flush=True)
for i, msg in enumerate(messages):
print(f" msg{i+1} subject={msg['subject']}", flush=True)
print(f" 附件{len(msg['attachment_paths'])}份 接收人{len(msg['receivers'])}人 type={msg['category']}", flush=True)
# STEP3 推送到测试接收人(仅验证流程,不发给真实接收人)
print("== STEP3 推送到测试接收人 37036361(夏一平)==", flush=True)
for i, msg in enumerate(messages):
doc_id = send_work_communication(
receiver_keywords=TEST_RECEIVER,
subject=msg["subject"],
content=msg["content"],
attachment_paths=msg["attachment_paths"],
creator_id="",
category=msg["category"],
)
print(f" msg{i+1} 推送成功 doc_id={doc_id}", flush=True)
print("== 全流程测试完成 ==", flush=True)