修改测算逻辑

This commit is contained in:
wuweihua
2026-09-18 17:09:43 +08:00
parent e08a36de91
commit bb240746a6
22 changed files with 435 additions and 44 deletions
@@ -179,6 +179,9 @@ public class BmsRegionSyncServiceImpl implements IBmsRegionSyncService
region.setCountryNameEn((String) name.get("common"));
}
// ISO代码(先取,后续用于港/澳/台中文名归一)
String cca2 = (String) country.get("cca2");
// 中文名 translations.zho.common(mledoze/countries 标准字段名为 zho)
Map<String, Object> translations = (Map<String, Object>) country.get("translations");
if (translations != null)
@@ -192,6 +195,21 @@ public class BmsRegionSyncServiceImpl implements IBmsRegionSyncService
// 注:取不到中文名时不再用英文名兜底,避免污染业务匹配。
// 若确需兜底,可改为 region.setCountryNameCn(StringUtils.EMPTY);
// 中国香港/中国澳门/中国台湾:数据源中文名为繁体「台灣」等,强制归一为规范简体名,
// 避免同步覆盖后页面显示不规范、且每次同步都被繁体名刷回。
if ("HK".equals(cca2))
{
region.setCountryNameCn("中国香港");
}
else if ("MO".equals(cca2))
{
region.setCountryNameCn("中国澳门");
}
else if ("TW".equals(cca2))
{
region.setCountryNameCn("中国台湾");
}
// ISO代码
region.setCountryCode2((String) country.get("cca2"));
region.setCountryCode3((String) country.get("cca3"));