feat: 更新3个插件版本并优化XQ0006考勤异常处理逻辑

- XQ0036门店员工起调薪处理:版本升至0.1.6,优化纳税单位解析逻辑,优先使用接口返回值,新增金色印象、金色湖畔、后浪会馆的纳税单位兜底规则
- XQ0047微盟数据导出:版本升至1.0.5,新增等待生成上限配置项,优化轮询超时处理逻辑
- XQ0006 EHR系统周考勤异常处理:版本升至1.4.1,重构推送逻辑,支持组织架构范围选择,新增dws推送通道,优化自动确认范围为整月轻微异常,新增组织架构同步功能
This commit is contained in:
2026-11-20 13:41:03 +08:00
parent 082d53c71c
commit a2f4e756ae
24 changed files with 1150 additions and 325 deletions
@@ -16,10 +16,20 @@ from . import config
from .data import weimob_export, weimob_login
def _parse_timeout_min(raw):
"""界面「等待生成上限(分钟)」→ int,非法值回落默认值并夹到允许范围。"""
lo, hi = config.POLL_TIMEOUT_LIMITS
try:
val = int(float(str(raw).strip() or config.POLL_TIMEOUT_MIN))
except (TypeError, ValueError):
return config.POLL_TIMEOUT_MIN
return max(lo, min(hi, val))
class WeimobExportPlugin(ScenePlugin):
id = "xq0047"
name = "微盟数据导出"
version = "1.0.3"
version = "1.0.5"
description = ("微盟商家后台订单数据自动导出:登录微盟(腾讯验证码需人工完成,登录态缓存复用),"
"按订单量自动等分时间区间批量创建导出任务,统一轮询下载并合并为一个 Excel")
platform = "" # 微盟自带登录页(腾讯验证码),插件内现场真登录,不使用底座共享登录态
@@ -32,6 +42,8 @@ class WeimobExportPlugin(ScenePlugin):
"wm_password": {"type": "string", "title": "微盟登录密码", "default": "",
"format": "password"},
"save_dir": {"type": "string", "title": "保存目录", "default": ""},
"poll_timeout_min": {"type": "number", "title": "等待生成上限(分钟)",
"default": config.POLL_TIMEOUT_MIN},
}
def run(self, fields, ctx) -> dict:
@@ -42,11 +54,13 @@ class WeimobExportPlugin(ScenePlugin):
username = str(fields.get("wm_username") or "").strip()
password = str(fields.get("wm_password") or "").strip()
save_dir = str(fields.get("save_dir") or "").strip().strip('"') or config.default_output_dir()
timeout_min = _parse_timeout_min(fields.get("poll_timeout_min"))
if not username or not password:
raise RuntimeError("微盟登录账号/密码缺失:请在插件界面填写并保存配置后重试")
os.makedirs(save_dir, exist_ok=True)
ctx.log(f"保存目录:{save_dir}")
ctx.log(f"等待生成上限:{timeout_min} 分钟")
# ---------- 登录(缓存复用,失效时浏览器现场登录) ----------
ctx.progress(2)
@@ -57,7 +71,7 @@ class WeimobExportPlugin(ScenePlugin):
ctx.progress(10)
# ---------- 导出 ----------
result = weimob_export.run_export(save_dir, ctx.progress)
result = weimob_export.run_export(save_dir, ctx.progress, timeout_min)
if not result.get("success"):
raise RuntimeError(result.get("message") or "微盟订单导出失败")