|
@@ -61,7 +61,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
var storageClientCsv2 = _azureStorage.GetCloudTableClient(name: "CoreServiceV2"); //Storage CSV2
|
|
|
var tableCouponClient = storageClientCsv2.GetTableReference("Coupon");
|
|
|
var tablePointsClient = storageClientCsv2.GetTableReference("Points");
|
|
|
- var redisClient = _azureRedis.GetRedisClient(4, _option.Location);
|
|
|
+ var redisClient = _azureRedis.GetRedisClient(4);
|
|
|
|
|
|
//存放user資料
|
|
|
Dictionary<string, TmidStics> tmidDic = new();
|
|
@@ -89,7 +89,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
var usersCoupons = tableCouponClient.Get<DynamicTableEntity>(id);
|
|
|
foreach (var coupon in usersCoupons)
|
|
|
{
|
|
|
- tmidStics.TmidCoupons.Add(
|
|
|
+ tmidStics.coupons.Add(
|
|
|
new TmidCoupon()
|
|
|
{
|
|
|
code = coupon.RowKey,
|
|
@@ -102,7 +102,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
foreach (var t in loginTime)
|
|
|
{
|
|
|
if (!t.Name.StartsWith("HiTeach") && !_dicClientIds.ContainsKey(t.Name)) continue;
|
|
|
- tmidStics.TmidLoginTime.Add(
|
|
|
+ tmidStics.login.Add(
|
|
|
new TmidLoginTime()
|
|
|
{
|
|
|
product = t.Name.StartsWith("HiTeach") ? t.Name.ToString().Split("-")[0] : _dicClientIds[t.Name],
|
|
@@ -115,6 +115,8 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
tmidStics.points.points = usersPoints.Properties["Points"].Int32Value.Value;
|
|
|
tmidStics.points.level = usersPoints.Properties["Level"].Int32Value.Value;
|
|
|
tmidStics.points.balance = usersPoints.Properties["Balance"].Int32Value.Value;
|
|
|
+ //個人服務授權
|
|
|
+ tmidStics.prod = await getTMIDAuthService(cosmosClientCsv2, id, "", true);
|
|
|
|
|
|
tmidDic.Add(id, tmidStics);
|
|
|
}
|
|
@@ -141,8 +143,8 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
tmidStics.country = doc.GetProperty("country").GetString();
|
|
|
tmidStics.province = doc.GetProperty("province").GetString();
|
|
|
tmidStics.city = doc.GetProperty("city").GetString();
|
|
|
- tmidStics.schoolCode = doc.GetProperty("schoolCode").GetString();
|
|
|
- tmidStics.schoolCodeW = doc.GetProperty("schoolCodeW").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;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -231,7 +233,6 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
startDate = obj.GetProperty("startDate").GetInt64(),
|
|
|
endDate = obj.GetProperty("endDate").GetInt64(),
|
|
|
number = obj.GetProperty("number").GetInt32(),
|
|
|
- unit = obj.GetProperty("unit").GetString(),
|
|
|
aprule = obj.GetProperty("aprule")
|
|
|
});
|
|
|
}
|
|
@@ -339,9 +340,9 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
public TmidSticsIes5 ies5 { get; set; } = new(); //IES統計資料
|
|
|
public TmidPoints points { get; set; } = new();
|
|
|
public TmidSokrates sokrates { get; set; } = new();
|
|
|
- public List<TmidCoupon> TmidCoupons { get; set; } = new();
|
|
|
- public List<TmidLoginTime> TmidLoginTime { get; set; } = new();
|
|
|
-
|
|
|
+ public List<TmidCoupon> coupons { get; set; } = new();
|
|
|
+ public List<TmidLoginTime> login { get; set; } = new();
|
|
|
+ public List<object> prod { get; set; } = new();
|
|
|
}
|
|
|
//TMID統計 IES5資訊
|
|
|
private class TmidSticsIes5
|