- XQ0036门店员工起调薪处理:版本升至0.1.6,优化纳税单位解析逻辑,优先使用接口返回值,新增金色印象、金色湖畔、后浪会馆的纳税单位兜底规则 - XQ0047微盟数据导出:版本升至1.0.5,新增等待生成上限配置项,优化轮询超时处理逻辑 - XQ0006 EHR系统周考勤异常处理:版本升至1.4.1,重构推送逻辑,支持组织架构范围选择,新增dws推送通道,优化自动确认范围为整月轻微异常,新增组织架构同步功能
45 lines
1.6 KiB
Python
45 lines
1.6 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}。
|
|
|
|
取值优先级:待办行 si_area/si_name(接口实时值)→ 已起薪记录 → 花名册 → 部门层级兜底。
|
|
待办行是当前组织口径,换店调薪时比已起薪记录里的旧值更准。
|
|
"""
|
|
started = started or {}
|
|
staff_base = staff_base or {}
|
|
|
|
unit_id = config.text(row.get("si_area"))
|
|
if unit_id:
|
|
return {"id": unit_id,
|
|
"name": config.text(row.get("si_name")) or config.TAX_UNITS.get(unit_id, ""),
|
|
"source": "待办(接口)"}
|
|
|
|
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"),
|
|
post=row.get("POST_ORG_NAME"),
|
|
brand=config.brand_for_unit(row.get("BELONG_UNIT_ORG_NAME")),
|
|
)
|
|
if unit_id:
|
|
return {"id": unit_id, "name": unit_name, "source": "部门层级"}
|
|
|
|
return {"id": "", "name": "", "source": "未匹配"}
|