update
This commit is contained in:
parent
7ce2bcb034
commit
51a488a5cb
|
|
@ -65,6 +65,7 @@
|
||||||
- `ldap_verify_tls`: 是否校验证书,默认 `true`。
|
- `ldap_verify_tls`: 是否校验证书,默认 `true`。
|
||||||
- `proxy_alias_domain`: 生成 `smtp:<sAMAccountName>@domain` 别名时使用的域名。
|
- `proxy_alias_domain`: 生成 `smtp:<sAMAccountName>@domain` 别名时使用的域名。
|
||||||
- `department_code_ad_attribute`: 部门编码写入的 AD 属性,默认 `departmentNumber`。
|
- `department_code_ad_attribute`: 部门编码写入的 AD 属性,默认 `departmentNumber`。
|
||||||
|
- `street_address_key`: 具体地址字段编码,默认 `extgzddxx_606508_618643707`,写入 AD 的 `streetAddress`。
|
||||||
- `default_company`: 固定公司名;不传时尝试取 EHR 根组织名称。
|
- `default_company`: 固定公司名;不传时尝试取 EHR 根组织名称。
|
||||||
- `location_mappings`: 工作地点到 AD 国家、省、市字段的映射。
|
- `location_mappings`: 工作地点到 AD 国家、省、市字段的映射。
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ def _scalar_value(raw: Any) -> str:
|
||||||
if val is None or str(val).strip() == "":
|
if val is None or str(val).strip() == "":
|
||||||
val = raw.get("showValue")
|
val = raw.get("showValue")
|
||||||
return str(val or "").strip()
|
return str(val or "").strip()
|
||||||
|
if isinstance(raw, (list, tuple, set)):
|
||||||
|
return "\n".join([str(x).strip() for x in raw if x is not None and str(x).strip() != ""])
|
||||||
return str(raw or "").strip()
|
return str(raw or "").strip()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -83,6 +85,18 @@ def _field_value(item: dict[str, Any], key: str) -> str:
|
||||||
s = _custom_prop_value(node.get("customProperties"), key)
|
s = _custom_prop_value(node.get("customProperties"), key)
|
||||||
if s:
|
if s:
|
||||||
return s
|
return s
|
||||||
|
for child in node.values():
|
||||||
|
if not isinstance(child, dict):
|
||||||
|
continue
|
||||||
|
s = _scalar_value(child.get(key))
|
||||||
|
if s:
|
||||||
|
return s
|
||||||
|
s = _translate_value(child, key)
|
||||||
|
if s:
|
||||||
|
return s
|
||||||
|
s = _custom_prop_value(child.get("customProperties"), key)
|
||||||
|
if s:
|
||||||
|
return s
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -540,6 +554,13 @@ class SyncEhrToAdUserJob(BaseJob):
|
||||||
office = _field_translate_or_value(item, "Place")
|
office = _field_translate_or_value(item, "Place")
|
||||||
workplace_text = _field_translate_or_value(item, work_location_text_key)
|
workplace_text = _field_translate_or_value(item, work_location_text_key)
|
||||||
street_address = _field_value(item, street_address_key)
|
street_address = _field_value(item, street_address_key)
|
||||||
|
if verbose_trace:
|
||||||
|
logger.info(
|
||||||
|
"AD 地址字段解析:sam=%s street_address_key=%s streetAddress=%r",
|
||||||
|
sam,
|
||||||
|
street_address_key,
|
||||||
|
street_address,
|
||||||
|
)
|
||||||
company = default_company or _root_org_name(org, org_by_oid)
|
company = default_company or _root_org_name(org, org_by_oid)
|
||||||
location_attrs = _location_from_workplace(workplace_text or office, location_mappings)
|
location_attrs = _location_from_workplace(workplace_text or office, location_mappings)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue