本次提交包含多项功能更新: 1. 为多个插件(xq0002/0003/0004/0008/0010/0011/0020/0031_xq0032/0033/0035/0037/0045_xq0046/0047/0048)新增 UI 界面及配置支持 2. 新增运行日志集中回传功能,客户端自动上传运行日志到中心机集中存储 3. 新增插件分类字段支持,用于场景库分组管理 4. 优化 xq0034/0037/0048 等插件的功能及描述 5. 修复控制面响应兼容问题,支持新旧版本数据格式 6. 新增 xq0033 插件的状态存储模块,用于历史记录管理 7. 优化 CRM 登录窗口模式,支持全屏置顶
51 lines
2.6 KiB
Python
51 lines
2.6 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""XQ0033 插件 - 执行摘要组装(summary 文本 + detail 结构化数据)。"""
|
||
|
||
|
||
def build_summary(today, t2, target_path, stats, push_result=None):
|
||
"""按执行结果拼装 {summary, detail}。
|
||
|
||
stats: report_rows/selected/new/fix/del/gap/rejoin_new/rejoin_total/cleared 计数;
|
||
update=False 表示本轮仅推送(不展示更新计数)。
|
||
push_result: {label: {success, message}} 或 None(未执行推送)。
|
||
"""
|
||
if stats.get("update", True):
|
||
detail = {
|
||
"运行日": today.isoformat(),
|
||
"积分日期(T-2)": t2.isoformat(),
|
||
"工作簿": target_path,
|
||
"报表人数": stats.get("report_rows", 0),
|
||
"圈人命中": stats.get("selected", 0),
|
||
"新增积分行": stats.get("new", 0),
|
||
"补漏日期数": stats.get("gap", 0),
|
||
"修正补积分行": stats.get("fix", 0),
|
||
"修正删积分行": stats.get("del", 0),
|
||
"再入职新增行": stats.get("rejoin_new", 0),
|
||
"再入职台账人数": stats.get("rejoin_total", 0),
|
||
"踢除无效积分格": stats.get("cleared", 0),
|
||
}
|
||
lines = [
|
||
f"XQ0033 完成(运行日 {today},积分日期 T-2={t2}):"
|
||
f"报表 {stats.get('report_rows', 0)} 人 / 圈人 {stats.get('selected', 0)} 人;"
|
||
f"积分导入新增 {stats.get('new', 0)} 行、修正补 {stats.get('fix', 0)} 行;"
|
||
f"积分删除 {stats.get('del', 0)} 行;当月再入职新增 {stats.get('rejoin_new', 0)} 行。",
|
||
f"工作簿:{target_path}",
|
||
]
|
||
if stats.get("cleared"):
|
||
lines.append(f"已踢除离职当月再入职人员无效积分段 {stats['cleared']} 个考勤状态。")
|
||
if stats.get("gap"):
|
||
lines.append(f"检测到漏处理日期 {stats['gap']} 天,已按新增段口径全量补齐。")
|
||
else:
|
||
detail = {"运行日": today.isoformat(), "工作簿": target_path}
|
||
lines = [f"XQ0033 完成(运行日 {today},仅推送):工作簿 {target_path}"]
|
||
if push_result:
|
||
parts = []
|
||
for label, res in push_result.items():
|
||
if res.get("success") is None:
|
||
parts.append(f"{label}:{res.get('message') or '未上传'}")
|
||
else:
|
||
parts.append(f"{label}:{'成功' if res.get('success') else '失败'}({res.get('message')})")
|
||
lines.append("OPM 推送:" + ";".join(parts))
|
||
detail["OPM推送"] = push_result
|
||
return "\n".join(lines), detail
|