|
@@ -48,7 +48,9 @@ namespace TEAMModelOS.Controllers
|
|
|
//};
|
|
|
public readonly static Dictionary<string, (string scope, string imeiType)> areaSchools = new Dictionary<string, (string scope, string imeiType)>
|
|
|
{
|
|
|
- {"2ffbd7f9-2445-4139-90a7-59e27c0d097e",("grouplist","ThirdIRS_139zhxy") }
|
|
|
+ {"2ffbd7f9-2445-4139-90a7-59e27c0d097e",("grouplist","ThirdIRS_139zhxy") },
|
|
|
+ {"hbcn",("school","ThirdIRS_139zhxy") },
|
|
|
+ {"habook",("school","ThirdIRS_139zhxy") }
|
|
|
};
|
|
|
|
|
|
public AzureCosmosFactory _azureCosmos;
|
|
@@ -110,8 +112,8 @@ namespace TEAMModelOS.Controllers
|
|
|
httpClient.DefaultRequestHeaders.Remove("timestamp");
|
|
|
}
|
|
|
httpClient.DefaultRequestHeaders.Add("timestamp", $"{now}");
|
|
|
- var phones = result.list.Where(y => y.id.Length==11).Select(x => x.id);
|
|
|
- if (phones!=null && phones.Count()>0)
|
|
|
+ var imeis = result.list.Select(x => x.id);
|
|
|
+ if (imeis!=null && imeis.Count()>0)
|
|
|
{
|
|
|
switch (lessonTask.type)
|
|
|
{
|
|
@@ -136,7 +138,7 @@ namespace TEAMModelOS.Controllers
|
|
|
items.Add(new { type = type, id = order, topicList = item.question });
|
|
|
order++;
|
|
|
}
|
|
|
- var data = new { phones, workId = lessonTask.id, title = lessonTask.examTask.title, works = items, callbackUrl };
|
|
|
+ var data = new { /*phones,*/ imeis= imeis, workId = lessonTask.id, title = lessonTask.examTask.title, works = items, callbackUrl };
|
|
|
HttpResponseMessage httpResponse = await httpClient.PostAsJsonAsync($"{URL139zhxy}/apiBaseData/studentCard/work/push", data);
|
|
|
if (httpResponse.StatusCode.Equals(HttpStatusCode.OK))
|
|
|
{
|
|
@@ -204,9 +206,12 @@ namespace TEAMModelOS.Controllers
|
|
|
if (!data.IsNullOrEmpty)
|
|
|
{
|
|
|
LessonTask lessonTask = data.ToString().ToObject<LessonTask>();
|
|
|
-
|
|
|
-
|
|
|
- Imei stu = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).ReadItemAsync<Imei>(result.phone, new PartitionKey("Imei"));
|
|
|
+ string kid = result.imei;
|
|
|
+ if (string.IsNullOrWhiteSpace(result.imei))
|
|
|
+ {
|
|
|
+ kid=result.phone;
|
|
|
+ }
|
|
|
+ Imei stu = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).ReadItemAsync<Imei>(kid, new PartitionKey("Imei"));
|
|
|
if (!string.IsNullOrWhiteSpace(stu?.channel) && !string.IsNullOrWhiteSpace(stu?.userid) && lessonTask.channel.Equals(stu?.channel))
|
|
|
{
|
|
|
// 處理單例復用,提高請求效率,避免ServiceTransportType.Persistent websocket斷線在Azure偶發的消息遺失
|
|
@@ -449,6 +454,7 @@ namespace TEAMModelOS.Controllers
|
|
|
public class ZHXY139IRSResult
|
|
|
{
|
|
|
public string phone { get; set; }
|
|
|
+ public string imei { get; set; }
|
|
|
public string workId { get; set; }
|
|
|
public List<ZHXY139IRSAnswer> answers { get; set; }
|
|
|
}
|