This commit is contained in:
Marsway 2026-05-14 16:00:39 +08:00
parent 042dc392fe
commit adb93ae6cc
2 changed files with 18 additions and 3 deletions

View File

@ -16,6 +16,7 @@
- EHR 目标值为空时不会清空 AD 字段。 - EHR 目标值为空时不会清空 AD 字段。
- 如果配置了 `target_sam_accounts`,只对列表中的 AD 账号执行同步。 - 如果配置了 `target_sam_accounts`,只对列表中的 AD 账号执行同步。
- 不同步 AD `title` 字段,不再往 AD 写入职务。 - 不同步 AD `title` 字段,不再往 AD 写入职务。
- `proxyAddresses` 只在 AD 当前为空时写入AD 已有值时跳过,不比较也不覆盖。
- `displayName``employeeInfo.customProperties.extDDNIC_606508_303466862` - `displayName``employeeInfo.customProperties.extDDNIC_606508_303466862`
- `department` 写入“EHR 部门编码 + EHR 部门名称”,例如 `V000076 IT` - `department` 写入“EHR 部门编码 + EHR 部门名称”,例如 `V000076 IT`
- `streetAddress` 默认取 `translateProperties.extgzddxx1_606508_892394263Text` - `streetAddress` 默认取 `translateProperties.extgzddxx1_606508_892394263Text`
@ -81,7 +82,7 @@
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `qjjdizcpjk` | 上海 | 上海 | 上海张江 | | `qjjdizcpjk` | 上海 | 上海 | 上海张江 |
| `j1lw6k13ya` | 陕西 | 西安 | 西安环普 | | `j1lw6k13ya` | 陕西 | 西安 | 西安环普 |
| `uzwlfke8vd` | 广州 | 深圳 | 深圳田厦 | | `uzwlfke8vd` / `uyglfkg8vd` | 广东 | 深圳 | 深圳田厦 |
| `mrtkjjhoxx` | 上海 | 上海 | 上海徐汇 | | `mrtkjjhoxx` | 上海 | 上海 | 上海徐汇 |
| `t21uyq5qvx` | 北京 | 北京 | 北京 | | `t21uyq5qvx` | 北京 | 北京 | 北京 |
| `nhu45qlh80` | 四川 | 成都 | 成都 | | `nhu45qlh80` | 四川 | 成都 | 成都 |

View File

@ -310,11 +310,19 @@ def _location_from_workspace_value(value: str, mappings: dict[str, Any] | None =
"l": "西安", "l": "西安",
"office": "西安环普", "office": "西安环普",
}, },
"uzwlfke8vd": {
"co": "China",
"c": "CN",
"countryCode": 156,
"st": "广东",
"l": "深圳",
"office": "深圳田厦",
},
"uyglfkg8vd": { "uyglfkg8vd": {
"co": "China", "co": "China",
"c": "CN", "c": "CN",
"countryCode": 156, "countryCode": 156,
"st": "广州", "st": "广",
"l": "深圳", "l": "深圳",
"office": "深圳田厦", "office": "深圳田厦",
}, },
@ -709,7 +717,13 @@ class SyncEhrToAdUserJob(BaseJob):
if department_code_attr and department_code: if department_code_attr and department_code:
attributes[department_code_attr] = department_code attributes[department_code_attr] = department_code
diff_attributes = _diff_ad_attributes(ad_user.get("attributes") or {}, attributes) ad_attrs = ad_user.get("attributes") or {}
if _ad_values(ad_attrs, "proxyAddresses"):
attributes.pop("proxyAddresses", None)
if verbose_trace:
logger.info("AD proxyAddresses 已有值跳过同步sam=%s dn=%s", sam, ad_user["dn"])
diff_attributes = _diff_ad_attributes(ad_attrs, attributes)
if not diff_attributes: if not diff_attributes:
skipped_unchanged += 1 skipped_unchanged += 1
if verbose_trace: if verbose_trace: