Browse Source

[BI]TMID用戶查詢 修正查詢地理資訊TW的國省市讀取架構

jeff 6 months ago
parent
commit
958c7beee5

+ 1 - 0
TEAMModelBI/ClientApp/src/language/lang/zh-cn.js

@@ -849,6 +849,7 @@ const zh_cn = {
             lastLoginTime: '上次登陆时间',
             lastLoginTime: '上次登陆时间',
             noUseRecently: '近期未使用',
             noUseRecently: '近期未使用',
             time: '时间',
             time: '时间',
+            day: '天',
             total: '共',
             total: '共',
             school: '学校',
             school: '学校',
             spaceAndRights: '空间与权益',
             spaceAndRights: '空间与权益',

+ 1 - 0
TEAMModelBI/ClientApp/src/language/lang/zh-tw.js

@@ -842,6 +842,7 @@ const zh_tw = {
             lastLoginTime: '上次登陸時間',
             lastLoginTime: '上次登陸時間',
             noUseRecently: '近期未使用',
             noUseRecently: '近期未使用',
             time: '時間',
             time: '時間',
+            day: '天',
             total: '共',
             total: '共',
             school: '學校',
             school: '學校',
             spaceAndRights: '空間與權益',
             spaceAndRights: '空間與權益',

+ 7 - 4
TEAMModelBI/Controllers/BITmid/TmidController.cs

@@ -194,10 +194,13 @@ namespace TEAMModelBI.Controllers.BITmid
                             string city = doc.GetProperty("city").GetString();
                             string city = doc.GetProperty("city").GetString();
                             string district = string.Empty;
                             string district = string.Empty;
                             if (!string.IsNullOrWhiteSpace(country) && country.Equals("TW"))
                             if (!string.IsNullOrWhiteSpace(country) && country.Equals("TW"))
-                            {
-                                district = city;
-                                city = province;
-                                province = string.Empty;
+                            {   //TW有兩種格式 (1)無province => 無須變更 (2)有province => city = province,district = city
+                                if(!string.IsNullOrWhiteSpace(province))
+                                {
+                                    district = city;
+                                    city = province;
+                                    province = string.Empty;
+                                }
                             }
                             }
                             tmidStics.country = (!string.IsNullOrWhiteSpace(country) && regionData.country.ContainsKey(country)) ? regionData.country[country].name.Replace("地區", "").Replace("地区", "") : country;
                             tmidStics.country = (!string.IsNullOrWhiteSpace(country) && regionData.country.ContainsKey(country)) ? regionData.country[country].name.Replace("地區", "").Replace("地区", "") : country;
                             tmidStics.province = (!string.IsNullOrWhiteSpace(country) && regionData.country.ContainsKey(country) && !string.IsNullOrWhiteSpace(province) && regionData.province.ContainsKey(country) && regionData.province[country].ContainsKey(province)) ? regionData.province[country][province].name : province;
                             tmidStics.province = (!string.IsNullOrWhiteSpace(country) && regionData.country.ContainsKey(country) && !string.IsNullOrWhiteSpace(province) && regionData.province.ContainsKey(country) && regionData.province[country].ContainsKey(province)) ? regionData.province[country][province].name : province;