|
@@ -73,7 +73,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
Dictionary<string, TmidStics> tmidDic = new();
|
|
|
|
|
|
QueryDefinition query =
|
|
|
- new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail FROM c WHERE (ARRAY_CONTAINS(@key, c.id) OR ARRAY_CONTAINS(@key, c.mobile))")
|
|
|
+ new QueryDefinition(@"SELECT c.id, c.name, c.picture, c.mobile, c.mail, c.lang, c.wechat, c.facebook, c.google, c.ding, c.apple, c.educloudtw, c.ts FROM c WHERE (ARRAY_CONTAINS(@key, c.id) OR ARRAY_CONTAINS(@key, c.mobile))")
|
|
|
.WithParameter("@key", tmids);
|
|
|
await foreach (var item in cosmosClientCsv2
|
|
|
.GetContainer("Core", "ID2")
|
|
@@ -88,10 +88,17 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
if(!tmids.Contains(id)) tmids.Add(id);
|
|
|
//基本資料
|
|
|
TmidStics tmidStics = (tmidDic.ContainsKey(id)) ? tmidDic[id] : new() { id = id };
|
|
|
- string tmidName = doc.GetProperty("name").GetString();
|
|
|
- string tmidMobile = GenDataMask(doc.GetProperty("mobile").GetString(), "mobile");
|
|
|
- string tmidMail = GenDataMask(doc.GetProperty("mail").GetString(), "mail");
|
|
|
-
|
|
|
+ tmidStics.name = doc.GetProperty("name").GetString();
|
|
|
+ tmidStics.picture = doc.GetProperty("picture").GetString();
|
|
|
+ tmidStics.mobile = GenDataMask(doc.GetProperty("mobile").GetString(), "mobile");
|
|
|
+ tmidStics.mail = GenDataMask(doc.GetProperty("mail").GetString(), "mail");
|
|
|
+ tmidStics.lang = (doc.TryGetProperty("lang", out JsonElement lang)) ? lang.GetString() : string.Empty;
|
|
|
+ tmidStics.wechat = (doc.TryGetProperty("wechat", out JsonElement wechat) && !string.IsNullOrWhiteSpace(wechat.GetString())) ? true : false;
|
|
|
+ tmidStics.facebook = (doc.TryGetProperty("facebook", out JsonElement facebook) && !string.IsNullOrWhiteSpace(facebook.GetString())) ? true : false;
|
|
|
+ tmidStics.google = (doc.TryGetProperty("google", out JsonElement google) && !string.IsNullOrWhiteSpace(google.GetString())) ? true : false;
|
|
|
+ tmidStics.ding = (doc.TryGetProperty("ding", out JsonElement ding) && !string.IsNullOrWhiteSpace(ding.GetString())) ? true : false;
|
|
|
+ tmidStics.apple = (doc.TryGetProperty("apple", out JsonElement apple) && !string.IsNullOrWhiteSpace(apple.GetString())) ? true : false;
|
|
|
+ tmidStics.ts = (doc.TryGetProperty("ts", out JsonElement ts)) ? ts.GetInt64() : 0;
|
|
|
//票券
|
|
|
var usersCoupons = tableCouponClient.Get<DynamicTableEntity>(id);
|
|
|
foreach (var coupon in usersCoupons)
|
|
@@ -140,7 +147,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
}
|
|
|
|
|
|
//ID進階資料
|
|
|
- query = new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail, c.country, c.province, c.city, c.schoolCode, c.schoolCodeW FROM c WHERE (ARRAY_CONTAINS(@key, c.id) OR ARRAY_CONTAINS(@key, c.mobile))")
|
|
|
+ query = new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail, c.country, c.province, c.city, c.schoolCode, c.schoolCodeW, c.unitType, c.unitName, c.jobTitle FROM c WHERE (ARRAY_CONTAINS(@key, c.id) OR ARRAY_CONTAINS(@key, c.mobile))")
|
|
|
.WithParameter("@key", tmids);
|
|
|
await foreach (var item in cosmosClientCsv2
|
|
|
.GetContainer("Core", "ID2")
|
|
@@ -161,6 +168,9 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
tmidStics.city = doc.GetProperty("city").GetString();
|
|
|
tmidStics.schoolCode = (doc.TryGetProperty("schoolCode", out JsonElement schCode)) ? schCode.GetString() : string.Empty;
|
|
|
tmidStics.schoolCodeW = (doc.TryGetProperty("schoolCodeW", out JsonElement schCodeW)) ? schCodeW.GetString() : string.Empty;
|
|
|
+ tmidStics.unitType = (doc.TryGetProperty("unitType", out JsonElement unitType)) ? unitType.GetString() : string.Empty;
|
|
|
+ tmidStics.unitName = (doc.TryGetProperty("unitName", out JsonElement unitName)) ? unitName.GetString() : string.Empty;
|
|
|
+ tmidStics.jobTitle = (doc.TryGetProperty("jobTitle", out JsonElement jobTitle)) ? jobTitle.GetString() : string.Empty;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -538,6 +548,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
{
|
|
|
public string id { get; set; }
|
|
|
public string name { get; set; }
|
|
|
+ public string picture { get; set; }
|
|
|
public string mobile { get; set; }
|
|
|
public string mail { get; set; }
|
|
|
public string country { get; set; }
|
|
@@ -545,6 +556,10 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
public string city { get; set; }
|
|
|
public string schoolCode { get; set; }
|
|
|
public string schoolCodeW { get; set; }
|
|
|
+ public string lang { get; set; }
|
|
|
+ public string unitType { get; set; } //1:基礎教育機構(K-小學) 2:中等教育機構(國中、高中/職) 3:高等教育機構 4:政府單位機構 5:NGO機構 6:企業機構 7:其他 8:學前教育 9:特殊教育
|
|
|
+ public string unitName { get; set; }
|
|
|
+ public string jobTitle { get; set; }
|
|
|
public TmidSticsIes5 ies5 { get; set; } = new(); //IES統計資料
|
|
|
public TmidPoints points { get; set; } = new();
|
|
|
public TmidSokrates sokrates { get; set; } = new();
|
|
@@ -553,6 +568,13 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
public List<TmidLoginTime> login { get; set; } = new();
|
|
|
public List<object> prod { get; set; } = new();
|
|
|
public TmidIot iot { get; set; } = new();
|
|
|
+ public bool wechat { get; set; }
|
|
|
+ public bool facebook { get; set; }
|
|
|
+ public bool google { get; set; }
|
|
|
+ public bool ding { get; set; }
|
|
|
+ public bool apple { get; set; }
|
|
|
+ public bool educloudtw { get; set; }
|
|
|
+ public long ts { get; set; } //資料最終變更時間
|
|
|
}
|
|
|
//TMID統計 IES5資訊
|
|
|
private class TmidSticsIes5
|