feat(xq0036): 接入钉钉群机器人通知,webhook/加签界面配置

新增 report/notify.py 走 dingtalk_sdk 推送处理汇总与失败/待人工核对明细(分批、状态色、试算标题);plugin.json 增加 dingtalk_sdk 依赖与 push_enabled/robot_webhook/robot_secret 字段;UI 新增「钉钉通知」一行配置区;版本 0.1.8。
This commit is contained in:
2026-11-20 15:45:13 +08:00
parent a2f4e756ae
commit 8cab685d8f
9 changed files with 205 additions and 18 deletions
@@ -28,6 +28,7 @@ from .logic import classify as classify_mod
from .logic import evaluate as evaluate_mod
from .logic import roster_map, standard_table
from .report.excel import export_result
from .report.notify import notify
LOGIN_HINT = "HR 登录态失效,请先在壳子右上角重新登录 HR 后重试"
@@ -37,7 +38,7 @@ class WageStartChangePlugin(ScenePlugin):
id = "xq0036"
name = "门店员工起调薪处理"
version = "0.1.6"
version = "0.1.8"
description = ("花名册职位序列过滤(仅门店服务/技师/管理序列):入职起薪、其他调薪"
"(自动判断换账套与调薪类型),核对工资项/岗位名称/固定项总额与标准一致后提交;"
"离职不处理。默认试算不提交,结果导出 xlsx。")
@@ -70,6 +71,18 @@ class WageStartChangePlugin(ScenePlugin):
"type": "boolean", "title": "调试日志", "default": False,
"description": "开启后输出完整调试信息(默认关闭)",
},
"push_enabled": {
"type": "boolean", "title": "钉钉群通知", "default": False,
"description": "开启后把本次处理汇总(成功/待人工核对/失败明细)推送到下方群机器人",
},
"robot_webhook": {
"type": "string", "title": "机器人 Webhook", "default": "",
"description": "钉钉群自定义机器人地址(https://oapi.dingtalk.com/robot/send?access_token=...)",
},
"robot_secret": {
"type": "string", "title": "加签密钥(Secret)", "default": "",
"description": "机器人安全设置选择「加签」时填写 SEC 开头的密钥;未加签留空",
},
}
# ---------------- 入口 ----------------
@@ -166,6 +179,7 @@ class WageStartChangePlugin(ScenePlugin):
counts[record.get("处理状态") or ""] = counts.get(record.get("处理状态") or "", 0) + 1
detail = ",".join(f"{k} {v}" for k, v in counts.items())
log(f"[INFO] 处理汇总:{detail}")
push = notify(records, counts, fields, log, dry_run=dry_run, path=path)
ctx.progress(100)
return {
"ok": True,
@@ -174,6 +188,7 @@ class WageStartChangePlugin(ScenePlugin):
"counts": counts,
"path": path,
"save_dir": save_dir,
"notify": push,
"summary": f"共 {len(records)} 条 · {detail or '无数据'}",
"detail": records,
}