- 配置由 save_dir / standard_path / roster_path 收敛为 work_dir:线下标准表在 该目录内按文件名关键词(起调薪薪资标准/薪资标准)与日期自动取最新, 处理结果 xlsx 同目录输出 - 星级改为按待办工号实时查询,失败再回退全量花名册导出 - 处理窗口留空=全部待办(原先默认当前自然月);界面、规则说明、README 同步
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""纳税单位兜底:优先沿用已显示/花名册值,缺省时按部门全路径中的会馆匹配。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from .. import config
|
|
|
|
|
|
def resolve(row: dict, started: dict = None, staff_base: dict = None) -> dict:
|
|
"""返回 {id, name, source};纳税单位缺失时始终按部门全路径兜底。"""
|
|
started = started or {}
|
|
staff_base = staff_base or {}
|
|
|
|
unit_id = config.text(started.get("taxUnitId"))
|
|
if unit_id:
|
|
return {"id": unit_id,
|
|
"name": config.text(started.get("taxUnitName")) or config.TAX_UNITS.get(unit_id, ""),
|
|
"source": "已显示"}
|
|
|
|
unit_id = config.text(staff_base.get("hsb_field_tax_unit_id"))
|
|
if unit_id:
|
|
return {"id": unit_id,
|
|
"name": config.TAX_UNITS.get(unit_id, ""),
|
|
"source": "花名册"}
|
|
|
|
unit_id, unit_name = config.tax_unit_by_org_path(row.get("ORG_FULL_PATH"))
|
|
if unit_id:
|
|
return {"id": unit_id, "name": unit_name, "source": "部门全路径"}
|
|
|
|
return {"id": "", "name": "", "source": "未匹配"}
|