|
@@ -136,7 +136,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
if (iscontinuation)
|
|
if (iscontinuation)
|
|
{
|
|
{
|
|
- continuationToken = item.GetContinuationToken();
|
|
|
|
|
|
+ continuationToken = item.ContinuationToken;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -275,7 +275,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
//}
|
|
//}
|
|
|
|
|
|
var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_areaId}", new PartitionKey("AreaSetting"));
|
|
var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{_areaId}", new PartitionKey("AreaSetting"));
|
|
- if (responseSet.Status == 200)
|
|
|
|
|
|
+ if (responseSet.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
|
|
using var fileJson = await JsonDocument.ParseAsync(responseSet.Content);
|
|
AreaSetting delSet = fileJson.ToObject<AreaSetting>();
|
|
AreaSetting delSet = fileJson.ToObject<AreaSetting>();
|
|
@@ -376,7 +376,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
if (schoolAssists.id != null)
|
|
if (schoolAssists.id != null)
|
|
{
|
|
{
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolAssists.id, new PartitionKey("ProductSum"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolAssists.id, new PartitionKey("ProductSum"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
@@ -442,7 +442,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
string _auth = HttpContext.GetXAuth("AuthToken");
|
|
string _auth = HttpContext.GetXAuth("AuthToken");
|
|
var (tmdId, tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(_auth, _option);
|
|
var (tmdId, tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(_auth, _option);
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey($"Base"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey($"Base"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
string sql = $"SELECT distinct value(c) FROM c join A1 in c.schools where A1.schoolId='{school.id}'";
|
|
string sql = $"SELECT distinct value(c) FROM c join A1 in c.schools where A1.schoolId='{school.id}'";
|
|
List<Teacher> teachers = new();
|
|
List<Teacher> teachers = new();
|
|
@@ -499,7 +499,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
{
|
|
{
|
|
School school = new();
|
|
School school = new();
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(sid, new PartitionKey("Base"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(sid, new PartitionKey("Base"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
school = json.ToObject<School>();
|
|
school = json.ToObject<School>();
|
|
@@ -767,7 +767,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
{
|
|
{
|
|
var resScInfo = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
|
|
var resScInfo = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
|
|
|
|
|
|
- if (resScInfo.Status == 200)
|
|
|
|
|
|
+ if (resScInfo.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var tchJson = await JsonDocument.ParseAsync(resScInfo.Content);
|
|
using var tchJson = await JsonDocument.ParseAsync(resScInfo.Content);
|
|
School scInfo = tchJson.ToObject<School>();
|
|
School scInfo = tchJson.ToObject<School>();
|
|
@@ -780,7 +780,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
Teacher teacher = new();
|
|
Teacher teacher = new();
|
|
SchoolTeacher schoolTeacher = new();
|
|
SchoolTeacher schoolTeacher = new();
|
|
var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
|
|
var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
|
|
- if (resTeacher.Status == 200)
|
|
|
|
|
|
+ if (resTeacher.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
|
|
using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
|
|
teacher = tchJson.ToObject<Teacher>();
|
|
teacher = tchJson.ToObject<Teacher>();
|
|
@@ -811,7 +811,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
if (teacher != null)
|
|
if (teacher != null)
|
|
{
|
|
{
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{schoolId}"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{schoolId}"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
schoolTeacher = json.ToObject<SchoolTeacher>();
|
|
schoolTeacher = json.ToObject<SchoolTeacher>();
|
|
@@ -893,7 +893,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
if (rmvFromSc) //從老師的學校列表移除該學校
|
|
if (rmvFromSc) //從老師的學校列表移除該學校
|
|
{
|
|
{
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey("Base"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey("Base"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
Teacher teacher = json.ToObject<Teacher>();
|
|
Teacher teacher = json.ToObject<Teacher>();
|
|
@@ -906,7 +906,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
foreach (var scId in scIds)
|
|
foreach (var scId in scIds)
|
|
{
|
|
{
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{scId}"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
if (rmvFromSc) //將該老師從學校的老師名單中移除
|
|
if (rmvFromSc) //將該老師從學校的老師名單中移除
|
|
{
|
|
{
|
|
@@ -968,7 +968,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
if (schools.Count > 0)
|
|
if (schools.Count > 0)
|
|
{
|
|
{
|
|
var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
|
|
var resTeacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
|
|
- if (resTeacher.Status == 200)
|
|
|
|
|
|
+ if (resTeacher.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
|
|
using var tchJson = await JsonDocument.ParseAsync(resTeacher.Content);
|
|
teacher = tchJson.ToObject<Teacher>();
|
|
teacher = tchJson.ToObject<Teacher>();
|
|
@@ -997,7 +997,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
existSchool.name = school.name;
|
|
existSchool.name = school.name;
|
|
|
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{school.id}"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Teacher-{school.id}"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
schoolTeacher = json.ToObject<SchoolTeacher>();
|
|
schoolTeacher = json.ToObject<SchoolTeacher>();
|
|
@@ -1030,7 +1030,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
msg.Append($"{school.name}[{school.id}]");
|
|
msg.Append($"{school.name}[{school.id}]");
|
|
}
|
|
}
|
|
|
|
|
|
- if (resTeacher.Status == 200)
|
|
|
|
|
|
+ if (resTeacher.StatusCode == HttpStatusCode.OK)
|
|
teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
|
|
teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
|
|
else
|
|
else
|
|
teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
|
|
teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
|
|
@@ -1109,30 +1109,30 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
}
|
|
}
|
|
|
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"Base"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"Base"));
|
|
- if (response.Status == 204)
|
|
|
|
- msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.Status},删除ID:{tempId}");
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.NoContent)
|
|
|
|
+ msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.StatusCode},删除ID:{tempId}");
|
|
else
|
|
else
|
|
- delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = response.Status });
|
|
|
|
|
|
+ delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = (int)HttpStatusCode.NoContent });
|
|
|
|
|
|
//删除学校信息中间
|
|
//删除学校信息中间
|
|
var resBiRel = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"BIRel"));
|
|
var resBiRel = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"BIRel"));
|
|
- if (resBiRel.Status == 204)
|
|
|
|
- msg.AppendLine($"{tmdName}【{tmdId}】删除学校信息中间件,删除状态:{resBiRel.Status},删除ID:{tempId}");
|
|
|
|
|
|
+ if (resBiRel.StatusCode == HttpStatusCode.NoContent)
|
|
|
|
+ msg.AppendLine($"{tmdName}【{tmdId}】删除学校信息中间件,删除状态:{resBiRel.StatusCode},删除ID:{tempId}");
|
|
else
|
|
else
|
|
- delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = response.Status });
|
|
|
|
|
|
+ delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "Base", type = 1, status = (int)response.StatusCode });
|
|
|
|
|
|
foreach (var item in scTchIds)
|
|
foreach (var item in scTchIds)
|
|
{
|
|
{
|
|
//学校教师信息
|
|
//学校教师信息
|
|
var tchRespnse = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{item}", new PartitionKey($"Teacher-{tempId}"));
|
|
var tchRespnse = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{item}", new PartitionKey($"Teacher-{tempId}"));
|
|
- if (tchRespnse.Status == 204)
|
|
|
|
- msg.AppendLine($"删除教师,删除状态:{tchRespnse.Status},删除ID:{item}");
|
|
|
|
|
|
+ if (tchRespnse.StatusCode == HttpStatusCode.NoContent)
|
|
|
|
+ msg.AppendLine($"删除教师,删除状态:{tchRespnse.StatusCode},删除ID:{item}");
|
|
else
|
|
else
|
|
- delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Teacher-{tempId}", type = 2, status = response.Status });
|
|
|
|
|
|
+ delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Teacher-{tempId}", type = 2, status = (int)response.StatusCode });
|
|
|
|
|
|
//教师基础信息
|
|
//教师基础信息
|
|
var tchBaseResponse = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{item}", new PartitionKey("Base"));
|
|
var tchBaseResponse = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{item}", new PartitionKey("Base"));
|
|
- if (tchBaseResponse.Status == 200)
|
|
|
|
|
|
+ if (tchBaseResponse.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(tchBaseResponse.Content);
|
|
using var json = await JsonDocument.ParseAsync(tchBaseResponse.Content);
|
|
Teacher teacher = json.ToObject<Teacher>();
|
|
Teacher teacher = json.ToObject<Teacher>();
|
|
@@ -1144,26 +1144,26 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
- delSchoolRels.Add(new DelSchoolRel { id = $"{item}", code = "Base", type = 2, status = response.Status });
|
|
|
|
|
|
+ delSchoolRels.Add(new DelSchoolRel { id = $"{item}", code = "Base", type = 2, status = (int)response.StatusCode });
|
|
}
|
|
}
|
|
//删除学校学生
|
|
//删除学校学生
|
|
foreach (var item in scStuIds)
|
|
foreach (var item in scStuIds)
|
|
{
|
|
{
|
|
var stuRespnse = await cosmosClient.GetContainer("TEAMModelOS", "Student").DeleteItemStreamAsync($"{item}", new PartitionKey($"Base-{tempId}"));
|
|
var stuRespnse = await cosmosClient.GetContainer("TEAMModelOS", "Student").DeleteItemStreamAsync($"{item}", new PartitionKey($"Base-{tempId}"));
|
|
- if (stuRespnse.Status == 204)
|
|
|
|
- msg.AppendLine($"删除学生,删除状态:{stuRespnse.Status},删除ID:{item}");
|
|
|
|
|
|
+ if (stuRespnse.StatusCode == HttpStatusCode.NoContent)
|
|
|
|
+ msg.AppendLine($"删除学生,删除状态:{stuRespnse.StatusCode},删除ID:{item}");
|
|
else
|
|
else
|
|
- delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Base-{tempId}", type = 3, status = response.Status });
|
|
|
|
|
|
+ delSchoolRels.Add(new DelSchoolRel() { id = $"{item}", code = $"Base-{tempId}", type = 3, status = (int)response.StatusCode });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//虛擬學校刪除
|
|
//虛擬學校刪除
|
|
else
|
|
else
|
|
{
|
|
{
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"VirtualBase"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").DeleteItemStreamAsync($"{tempId}", new PartitionKey($"VirtualBase"));
|
|
- if (response.Status == 204)
|
|
|
|
- msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.Status},删除ID:{tempId}");
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.NoContent)
|
|
|
|
+ msg.AppendLine($"{tmdName}【{tmdId}】删除学校,删除状态:{response.StatusCode},删除ID:{tempId}");
|
|
else
|
|
else
|
|
- delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "VirtualBase", type = 1, status = response.Status });
|
|
|
|
|
|
+ delSchoolRels.Add(new DelSchoolRel() { id = $"{tempId}", code = "VirtualBase", type = 1, status = (int)response.StatusCode });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1267,7 +1267,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
if (schoolInfo != null)
|
|
if (schoolInfo != null)
|
|
{
|
|
{
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolInfo.id, new PartitionKey("ProductSum"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(schoolInfo.id, new PartitionKey("ProductSum"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
@@ -1344,7 +1344,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
RecSchool recSchool = new();
|
|
RecSchool recSchool = new();
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
recSchool = json.ToObject<RecSchool>();
|
|
recSchool = json.ToObject<RecSchool>();
|
|
@@ -1864,7 +1864,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
AnSchool school = new(); //学校基础基础信息
|
|
AnSchool school = new(); //学校基础基础信息
|
|
|
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync($"{schoolId}", new PartitionKey("Base"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
school = json.ToObject<AnSchool>();
|
|
school = json.ToObject<AnSchool>();
|
|
@@ -1883,7 +1883,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
var subCnt = subs.Select(x => new { name = x.key, value = x.count });
|
|
var subCnt = subs.Select(x => new { name = x.key, value = x.count });
|
|
|
|
|
|
var responseProduct = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey("ProductSum"));
|
|
var responseProduct = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(school.id, new PartitionKey("ProductSum"));
|
|
- if (responseProduct.Status == 200)
|
|
|
|
|
|
+ if (responseProduct.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(responseProduct.Content);
|
|
using var json = await JsonDocument.ParseAsync(responseProduct.Content);
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement _serial) && !_serial.ValueKind.Equals(JsonValueKind.Null))
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement _serial) && !_serial.ValueKind.Equals(JsonValueKind.Null))
|
|
@@ -1986,7 +1986,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
allCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", serialAllSql, $"Product-{scProd.id}");
|
|
allCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", serialAllSql, $"Product-{scProd.id}");
|
|
|
|
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProd.id, new PartitionKey("ProductSum"));
|
|
var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProd.id, new PartitionKey("ProductSum"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
|
|
@@ -2417,7 +2417,7 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
|
|
|
////取得各產品目前可得數量
|
|
////取得各產品目前可得數量
|
|
var response = await db.ReadItemStreamAsync(school_code.ToString(), new PartitionKey($"ProductSum"));
|
|
var response = await db.ReadItemStreamAsync(school_code.ToString(), new PartitionKey($"ProductSum"));
|
|
- if (response.Status == 200)
|
|
|
|
|
|
+ if (response.StatusCode == HttpStatusCode.OK)
|
|
{
|
|
{
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
using var json = await JsonDocument.ParseAsync(response.Content);
|
|
productSum = json.ToObject<SchoolProductSum>();
|
|
productSum = json.ToObject<SchoolProductSum>();
|