hr_sdk: ledger.export_advance_pay 增强;workflow 新增 list_supervised/task_ids/form_info/export_detail(全部流程详细数据 38 列,含收款银行/账号)。 printkit: registry 支持按部门名(humanresource/it)解析打印机,供 XQ0012 选机。
88 lines
3.2 KiB
Python
88 lines
3.2 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""hr_sdk · HR(RedseaPlatform)接口 SDK(纯运行库,只能被调用)。
|
||
|
||
分工:**SDK 出接口,插件出业务**。这里封装登录态访问、查询条件加密、异步导出、
|
||
分页拉全、模板解析等接口事实;异常判定、店长分组、文案、列名映射、落盘策略留在插件。
|
||
|
||
当前版本(0.2.3)覆盖:
|
||
|
||
========================== ==========================================================
|
||
接口 入口
|
||
========================== ==========================================================
|
||
通用请求 / 分页 / 下载 :class:`client.HrClient`
|
||
查询条件加密(commonQuery) :mod:`query`(``condition`` / ``date_range`` / ``encode``)
|
||
异步导出机制 :mod:`export`(bridge 注册 + WS 订阅 + 下载)
|
||
花名册(在职/离职) :mod:`roster`(``export`` / ``export_one``)
|
||
预入职台账 / 调动台账 / 预支台账 :mod:`ledger`(``export_pre_entry`` / ``export_transfer`` /
|
||
``export_advance_pay``)
|
||
组织机构 :mod:`org`(``rows``)
|
||
工资待办 / 账套 / 起调薪 :mod:`wage`(``rows`` / ``accounts`` / ``account_items`` /
|
||
``started`` / ``standards`` / ``submit_start`` / ``submit_change``)
|
||
========================== ==========================================================
|
||
|
||
典型用法::
|
||
|
||
from hr_sdk import HrClient, roster, ledger
|
||
|
||
client = HrClient(ctx.get_session("hr"), log=ctx.log) # 借来的会话,不 close
|
||
path = roster.export(client, statuses=["在职"], output=out / "花名册.xlsx")
|
||
transfer = ledger.export_transfer(client, output=out / "调动台账.xlsx")
|
||
|
||
契约:不读命令行参数、不 ``sys.exit``、不 ``print``(用 ``log`` 回调)、
|
||
不 ``close()`` 借来的 session;异常统一为 :class:`errors.HrError` 子类。
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
__version__ = "0.2.3"
|
||
|
||
from . import (attach, attendance, auth, client, config, contract, errors, export, imports,
|
||
ledger, org, query, roster, seal, session, shift, wage, workflow)
|
||
from .client import HrClient
|
||
from .config import HR_BASE_URL, WS_EXPORT_THEME, base_params, cookies_file
|
||
from .errors import (ApiError, AuthError, CancelledError, ConfigError, ExportTimeoutError,
|
||
HrError, SessionExpiredError)
|
||
from .query import condition, date_range, encode, encode_common_query
|
||
from .session import SessionLike, looks_like_login_page, session_from_cookies
|
||
|
||
__all__ = [
|
||
"ApiError",
|
||
"AuthError",
|
||
"CancelledError",
|
||
"ConfigError",
|
||
"ExportTimeoutError",
|
||
"HR_BASE_URL",
|
||
"HrClient",
|
||
"HrError",
|
||
"SessionExpiredError",
|
||
"SessionLike",
|
||
"WS_EXPORT_THEME",
|
||
"attach",
|
||
"attendance",
|
||
"auth",
|
||
"base_params",
|
||
"client",
|
||
"condition",
|
||
"config",
|
||
"contract",
|
||
"cookies_file",
|
||
"date_range",
|
||
"encode",
|
||
"encode_common_query",
|
||
"errors",
|
||
"export",
|
||
"imports",
|
||
"ledger",
|
||
"looks_like_login_page",
|
||
"org",
|
||
"query",
|
||
"roster",
|
||
"seal",
|
||
"session",
|
||
"session_from_cookies",
|
||
"shift",
|
||
"wage",
|
||
"workflow",
|
||
"__version__",
|
||
]
|