|
@@ -1757,6 +1757,7 @@ namespace TEAMModelOS.SDK
|
|
|
writer.WriteString("style", "smart");
|
|
|
writer.WriteString("openType", "1");
|
|
|
writer.WriteString("scope", "school");
|
|
|
+ writer.WriteNumber("graduate", 0);
|
|
|
writer.WriteEndObject();
|
|
|
writer.Flush();
|
|
|
|
|
@@ -1950,16 +1951,59 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
List<Student> graduate_students = new List<Student>();
|
|
|
List<Class> school_classes = new List<Class>();
|
|
|
+ List<object> ret = new List<object>();
|
|
|
string queryText = "";
|
|
|
if (graduate == 0)
|
|
|
{
|
|
|
- queryText = $"SELECT * FROM c WHERE c.code = 'Base-{schoolId}' and (c.graduate = 0 or IS_DEFINED(c.graduate) = false )";
|
|
|
+ ///查询当年的毕业班
|
|
|
+ string sql = sql = $"SELECT value c FROM c where c.graduate =0"; ;
|
|
|
+
|
|
|
+ var client = _azureCosmos.GetCosmosClient();
|
|
|
+ await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<Class>
|
|
|
+ (queryText: sql,
|
|
|
+ requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{schoolId}") }))
|
|
|
+ {
|
|
|
+ school_classes.Add(item);
|
|
|
+ }
|
|
|
+
|
|
|
+ queryText = $"SELECT value c FROM c WHERE c.code = 'Base-{schoolId}' and (c.classId =null or IS_DEFINED(c.classId) = false or c.classId in ( {string.Join(",", school_classes.Select(x => $"'{x.id}'"))}))";
|
|
|
+ string continuationToken = string.Empty;
|
|
|
+ var container = _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student");
|
|
|
+ var studentsRes = await container.GetList<Student>(queryText, $"Base-{schoolId}");
|
|
|
+ if (studentsRes.list.IsNotEmpty())
|
|
|
+ {
|
|
|
+ foreach (var student in studentsRes.list)
|
|
|
+ {
|
|
|
+ var imeiObj = imeis.Find(x => x.stuid.Equals(student.id));
|
|
|
+ Class stuClass = school_classes.Find(x =>!string.IsNullOrWhiteSpace(student.classId) && x.id.Equals(student.classId));
|
|
|
+ ret.Add(new
|
|
|
+ {
|
|
|
+ student.id,
|
|
|
+ student.name,
|
|
|
+ student.picture,
|
|
|
+ student.year,
|
|
|
+ student.no,
|
|
|
+ classId = stuClass?.id,
|
|
|
+ classNo = stuClass?.no,
|
|
|
+ className = stuClass?.name,
|
|
|
+ gradeId = stuClass?.gradeId,
|
|
|
+ student.periodId,
|
|
|
+ classYear = stuClass?.year,
|
|
|
+ irs = student.irs,
|
|
|
+ imei = imeiObj?.id,
|
|
|
+ gender = student.gender,
|
|
|
+ hasEduOpenId = (!string.IsNullOrWhiteSpace(student.openId)) ? true : false,
|
|
|
+ guardians = student.guardians,
|
|
|
+ graduate = !string.IsNullOrWhiteSpace(student.classId) ? 0:student.graduate
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
queryText = $"SELECT * FROM c WHERE c.code = 'Base-{schoolId}' and c.graduate = 1 and c.year ={inyear} ";
|
|
|
|
|
|
-
|
|
|
///查询当年的毕业班
|
|
|
string sql = sql = $"SELECT value c FROM c where c.graduate =1 and c.year ={inyear}"; ;
|
|
|
|
|
@@ -1973,215 +2017,209 @@ namespace TEAMModelOS.SDK
|
|
|
//如果已经毕业的班级不为空。
|
|
|
if (school_classes.IsNotEmpty())
|
|
|
{
|
|
|
- string classSql = $"SELECT value c FROM c WHERE c.code = 'Base-{schoolId}' and c.graduate = 1 and c.classId in( {string.Join(",", school_classes.Select(x => $"'{x.id}'"))} )";
|
|
|
+ string classSql = $"SELECT value c FROM c WHERE c.code = 'Base-{schoolId}' and c.classId in( {string.Join(",", school_classes.Select(x => $"'{x.id}'"))} )";
|
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIteratorSql<Student>(queryText: classSql,
|
|
|
requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
|
|
|
{
|
|
|
graduate_students.Add(item);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //回傳用ContinuationToken
|
|
|
- string continuationToken = string.Empty;
|
|
|
- var container = _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student");
|
|
|
-
|
|
|
- //進行學生資料的查詢 TEAMModelOS-Student
|
|
|
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
|
|
|
- .GetItemQueryStreamIteratorSql(
|
|
|
- queryText: queryText,
|
|
|
- requestOptions: new QueryRequestOptions()
|
|
|
- { PartitionKey = new PartitionKey($"Base-{schoolId}"), MaxItemCount = -1 }))
|
|
|
- {
|
|
|
- continuationToken = item.ContinuationToken;
|
|
|
- using var json = await JsonDocument.ParseAsync(item.Content);
|
|
|
- if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
|
+ graduate_students.ForEach(o =>
|
|
|
{
|
|
|
- List<(string id, string name, string picture, int year, string no, List<StudentGuardian> guardians)> students = new List<(string id, string name, string picture, int year, string no, List<StudentGuardian> guardians)>();
|
|
|
-
|
|
|
- var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
|
|
|
- while (accounts.MoveNext())
|
|
|
+ var imeiObj = imeis.Find(x => x.stuid.Equals(o.id));
|
|
|
+ Class stuClass = school_classes.Find(x => x.id.Equals(o.classId));
|
|
|
+ ret.Add(
|
|
|
+ new
|
|
|
{
|
|
|
- JsonElement acc = accounts.Current;
|
|
|
-
|
|
|
- string classId = acc.GetProperty("classId").GetString();
|
|
|
- acc.TryGetProperty("irs", out JsonElement irs);
|
|
|
- acc.TryGetProperty("guardians", out JsonElement _guardians);
|
|
|
- List<StudentGuardian> guardians = new List<StudentGuardian>();
|
|
|
-
|
|
|
- if (_guardians.ValueKind.Equals(JsonValueKind.Array))
|
|
|
- {
|
|
|
- guardians = _guardians.Deserialize<List<StudentGuardian>>();
|
|
|
- if (guardians.Any())
|
|
|
- {
|
|
|
- guardians = guardians.FindAll(x => !string.IsNullOrWhiteSpace(x.mobile));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var imeiObj = imeis.Find(x => x.stuid.Equals(acc.GetProperty("id").GetString()));
|
|
|
- if (string.IsNullOrWhiteSpace(classId))
|
|
|
- {
|
|
|
- notJoinClassStuds.Add(
|
|
|
- (
|
|
|
- acc.GetProperty("id").GetString(),
|
|
|
- acc.GetProperty("name").GetString(),
|
|
|
- acc.GetProperty("picture").GetString(),
|
|
|
- acc.GetProperty("year").GetInt32(),
|
|
|
- acc.GetProperty("no").GetString(),
|
|
|
- acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
|
|
|
- $"{irs}",
|
|
|
- imeiObj?.id,//imei
|
|
|
- acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
|
|
|
- acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}") : 0,
|
|
|
- acc.TryGetProperty("openId", out JsonElement _openId) && !string.IsNullOrWhiteSpace(_openId.GetString()) ? true : false,
|
|
|
- guardians
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (dicClassStuds.ContainsKey(classId))
|
|
|
- {
|
|
|
- dicClassStuds[classId].Add(
|
|
|
- (
|
|
|
- acc.GetProperty("id").GetString(),
|
|
|
- acc.GetProperty("name").GetString(),
|
|
|
- acc.GetProperty("picture").GetString(),
|
|
|
- acc.GetProperty("year").GetInt32(),
|
|
|
- acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
|
|
|
- $"{irs}",
|
|
|
- imeiObj?.id,//imei
|
|
|
- acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
|
|
|
- acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}") : 0,
|
|
|
- acc.TryGetProperty("openId", out JsonElement _openId) && !string.IsNullOrWhiteSpace(_openId.GetString()) ? true : false,
|
|
|
- guardians
|
|
|
- )
|
|
|
- );
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dicClassStuds.Add(classId,
|
|
|
- new List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, int graduate, bool hasEduOpenId, List<StudentGuardian> guardians)>()
|
|
|
- {
|
|
|
- (
|
|
|
- acc.GetProperty("id").GetString(),
|
|
|
- acc.GetProperty("name").GetString(),
|
|
|
- acc.GetProperty("picture").GetString(),
|
|
|
- acc.GetProperty("year").GetInt32(),
|
|
|
- acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId",out JsonElement _periodId)&& _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
|
|
|
- $"{irs}" ,
|
|
|
- imeiObj?.id,//imei
|
|
|
- acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
|
|
|
- acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}"): 0,
|
|
|
- acc.TryGetProperty("openId", out JsonElement _openId) && !string.IsNullOrWhiteSpace(_openId.GetString()) ? true : false,
|
|
|
- guardians
|
|
|
- )
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ o.id,
|
|
|
+ o.name,
|
|
|
+ o.picture,
|
|
|
+ o.year,
|
|
|
+ o.no,
|
|
|
+ classId = stuClass?.id,
|
|
|
+ classNo = stuClass?.no,
|
|
|
+ className = stuClass?.name,
|
|
|
+ gradeId = stuClass?.gradeId,
|
|
|
+ o.periodId,
|
|
|
+ classYear = stuClass?.year,
|
|
|
+ irs = o.irs,
|
|
|
+ imei = imeiObj?.id,
|
|
|
+ gender = o.gender,
|
|
|
+ hasEduOpenId = (!string.IsNullOrWhiteSpace(o.openId)) ? true : false,
|
|
|
+ guardians = o.guardians,
|
|
|
+ graduate=1
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- //查學生所屬的教室及座號
|
|
|
- List<object> ret = new List<object>();
|
|
|
+ //await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
|
|
|
+ // .GetItemQueryStreamIteratorSql(
|
|
|
+ // queryText: queryText,
|
|
|
+ // requestOptions: new QueryRequestOptions()
|
|
|
+ // { PartitionKey = new PartitionKey($"Base-{schoolId}"), MaxItemCount = -1 }))
|
|
|
+ //{
|
|
|
+ // continuationToken = item.ContinuationToken;
|
|
|
+ // using var json = await JsonDocument.ParseAsync(item.Content);
|
|
|
+ // if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
|
+ // {
|
|
|
+
|
|
|
+ // var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
|
|
|
+ // while (accounts.MoveNext())
|
|
|
+ // {
|
|
|
+ // JsonElement acc = accounts.Current;
|
|
|
+
|
|
|
+ // string classId = acc.GetProperty("classId").GetString();
|
|
|
+ // acc.TryGetProperty("irs", out JsonElement irs);
|
|
|
+ // acc.TryGetProperty("guardians", out JsonElement _guardians);
|
|
|
+ // List<StudentGuardian> guardians = new List<StudentGuardian>();
|
|
|
+
|
|
|
+ // if (_guardians.ValueKind.Equals(JsonValueKind.Array))
|
|
|
+ // {
|
|
|
+ // guardians = _guardians.Deserialize<List<StudentGuardian>>();
|
|
|
+ // if (guardians.Any())
|
|
|
+ // {
|
|
|
+ // guardians = guardians.FindAll(x => !string.IsNullOrWhiteSpace(x.mobile));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // var imeiObj = imeis.Find(x => x.stuid.Equals(acc.GetProperty("id").GetString()));
|
|
|
+ // if (string.IsNullOrWhiteSpace(classId))
|
|
|
+ // {
|
|
|
+ // notJoinClassStuds.Add(
|
|
|
+ // (
|
|
|
+ // acc.GetProperty("id").GetString(),
|
|
|
+ // acc.GetProperty("name").GetString(),
|
|
|
+ // acc.GetProperty("picture").GetString(),
|
|
|
+ // acc.GetProperty("year").GetInt32(),
|
|
|
+ // acc.GetProperty("no").GetString(),
|
|
|
+ // acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
|
|
|
+ // $"{irs}",
|
|
|
+ // imeiObj?.id,//imei
|
|
|
+ // acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
|
|
|
+ // acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}") : 0,
|
|
|
+ // acc.TryGetProperty("openId", out JsonElement _openId) && !string.IsNullOrWhiteSpace(_openId.GetString()) ? true : false,
|
|
|
+ // guardians
|
|
|
+ // )
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // if (dicClassStuds.ContainsKey(classId))
|
|
|
+ // {
|
|
|
+ // dicClassStuds[classId].Add(
|
|
|
+ // (
|
|
|
+ // acc.GetProperty("id").GetString(),
|
|
|
+ // acc.GetProperty("name").GetString(),
|
|
|
+ // acc.GetProperty("picture").GetString(),
|
|
|
+ // acc.GetProperty("year").GetInt32(),
|
|
|
+ // acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
|
|
|
+ // $"{irs}",
|
|
|
+ // imeiObj?.id,//imei
|
|
|
+ // acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
|
|
|
+ // acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}") : 0,
|
|
|
+ // acc.TryGetProperty("openId", out JsonElement _openId) && !string.IsNullOrWhiteSpace(_openId.GetString()) ? true : false,
|
|
|
+ // guardians
|
|
|
+ // )
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // dicClassStuds.Add(classId,
|
|
|
+ // new List<(string id, string name, string picture, int year, string no, string periodId, string irs, string imei, string gender, int graduate, bool hasEduOpenId, List<StudentGuardian> guardians)>()
|
|
|
+ // {
|
|
|
+ // (
|
|
|
+ // acc.GetProperty("id").GetString(),
|
|
|
+ // acc.GetProperty("name").GetString(),
|
|
|
+ // acc.GetProperty("picture").GetString(),
|
|
|
+ // acc.GetProperty("year").GetInt32(),
|
|
|
+ // acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId",out JsonElement _periodId)&& _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
|
|
|
+ // $"{irs}" ,
|
|
|
+ // imeiObj?.id,//imei
|
|
|
+ // acc.TryGetProperty("gender", out JsonElement _gender) && _gender.ValueKind.Equals(JsonValueKind.String) ? _gender.GetString() : null,
|
|
|
+ // acc.TryGetProperty("graduate", out JsonElement _graduate) && _graduate.ValueKind.Equals(JsonValueKind.Number) ? int.Parse($"{_graduate}"): 0,
|
|
|
+ // acc.TryGetProperty("openId", out JsonElement _openId) && !string.IsNullOrWhiteSpace(_openId.GetString()) ? true : false,
|
|
|
+ // guardians
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//查教室的資訊,用以取得gradeId,periodId資訊。
|
|
|
- var classInfos = await getClassInfoUseId(_azureCosmos, _dingDing, _option, schoolId, dicClassStuds.Keys.ToList());
|
|
|
+ // var classInfos = await getClassInfoUseId(_azureCosmos, _dingDing, _option, schoolId, dicClassStuds.Keys.ToList());
|
|
|
|
|
|
//輪循所有教室學生的資料
|
|
|
- foreach (var classStud in dicClassStuds)
|
|
|
- {
|
|
|
- string classId = null, classNo = null, className = null, gradeId = null, periodId = null;
|
|
|
- int classYear = -1;
|
|
|
- if (classInfos.ContainsKey(classStud.Key))
|
|
|
- {
|
|
|
- classId = classInfos[classStud.Key].GetProperty("id").GetString();
|
|
|
- classNo = classInfos[classStud.Key].GetProperty("no").GetString();
|
|
|
- className = classInfos[classStud.Key].GetProperty("name").GetString();
|
|
|
- periodId = classInfos[classStud.Key].TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null;
|
|
|
- if (classInfos[classStud.Key].TryGetProperty("year", out JsonElement year))
|
|
|
- {
|
|
|
- if (year.ValueKind.Equals(JsonValueKind.Number))
|
|
|
- {
|
|
|
- classYear = classInfos[classStud.Key].GetProperty("year").GetInt32();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var tmp = classStud.Value.Select(o =>
|
|
|
- new
|
|
|
- {
|
|
|
- o.id,
|
|
|
- o.name,
|
|
|
- o.picture,
|
|
|
- o.year,
|
|
|
- o.no,
|
|
|
- classId,
|
|
|
- classNo,
|
|
|
- className,
|
|
|
- gradeId,
|
|
|
- periodId = string.IsNullOrEmpty(periodId) ? o.periodId : periodId,
|
|
|
- classYear,
|
|
|
- irs = o.irs,
|
|
|
- imei = o.imei,
|
|
|
- gender = o.gender,
|
|
|
- graduate = o.graduate,
|
|
|
- hasEduOpenId = o.hasEduOpenId,
|
|
|
- guardians = o.guardians,
|
|
|
- });
|
|
|
- ret.AddRange(tmp);
|
|
|
- }
|
|
|
-
|
|
|
- //彙整沒有加入教室的學生
|
|
|
- notJoinClassStuds.ForEach(o => ret.Add(
|
|
|
- new
|
|
|
- {
|
|
|
- o.id,
|
|
|
- o.name,
|
|
|
- o.picture,
|
|
|
- o.year,
|
|
|
- o.no,
|
|
|
- classId = (string)null,
|
|
|
- classNo = (string)null,
|
|
|
- className = (string)null,
|
|
|
- gradeId = (string)null,
|
|
|
- o.periodId,
|
|
|
- classYear = -1,
|
|
|
- irs = o.irs,
|
|
|
- imei = o.imei,
|
|
|
- gender = o.gender,
|
|
|
- hasEduOpenId = o.hasEduOpenId,
|
|
|
- guardians = o.guardians,
|
|
|
- }));
|
|
|
-
|
|
|
- graduate_students.ForEach(o =>
|
|
|
- {
|
|
|
- var imeiObj = imeis.Find(x => x.stuid.Equals(o.id));
|
|
|
- Class stuClass = school_classes.Find(x => x.id.Equals(o.classId));
|
|
|
- ret.Add(
|
|
|
- new
|
|
|
- {
|
|
|
- o.id,
|
|
|
- o.name,
|
|
|
- o.picture,
|
|
|
- o.year,
|
|
|
- o.no,
|
|
|
- classId = stuClass?.id,
|
|
|
- classNo = stuClass?.no,
|
|
|
- className = stuClass?.name,
|
|
|
- gradeId = stuClass?.gradeId,
|
|
|
- o.periodId,
|
|
|
- classYear = stuClass?.year,
|
|
|
- irs = o.irs,
|
|
|
- imei = imeiObj?.id,
|
|
|
- gender = o.gender,
|
|
|
- hasEduOpenId = (!string.IsNullOrWhiteSpace(o.openId)) ? true : false,
|
|
|
- guardians = o.guardians,
|
|
|
- });
|
|
|
- });
|
|
|
+ //foreach (var classStud in dicClassStuds)
|
|
|
+ //{
|
|
|
+ // string classId = null, classNo = null, className = null, gradeId = null, periodId = null;
|
|
|
+ // int classYear = -1;
|
|
|
+ // if (classInfos.ContainsKey(classStud.Key))
|
|
|
+ // {
|
|
|
+ // classId = classInfos[classStud.Key].GetProperty("id").GetString();
|
|
|
+ // classNo = classInfos[classStud.Key].GetProperty("no").GetString();
|
|
|
+ // className = classInfos[classStud.Key].GetProperty("name").GetString();
|
|
|
+ // periodId = classInfos[classStud.Key].TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null;
|
|
|
+ // if (classInfos[classStud.Key].TryGetProperty("year", out JsonElement year))
|
|
|
+ // {
|
|
|
+ // if (year.ValueKind.Equals(JsonValueKind.Number))
|
|
|
+ // {
|
|
|
+ // classYear = classInfos[classStud.Key].GetProperty("year").GetInt32();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // var tmp = classStud.Value.Select(o =>
|
|
|
+ // new
|
|
|
+ // {
|
|
|
+ // o.id,
|
|
|
+ // o.name,
|
|
|
+ // o.picture,
|
|
|
+ // o.year,
|
|
|
+ // o.no,
|
|
|
+ // classId,
|
|
|
+ // classNo,
|
|
|
+ // className,
|
|
|
+ // gradeId,
|
|
|
+ // periodId = string.IsNullOrEmpty(periodId) ? o.periodId : periodId,
|
|
|
+ // classYear,
|
|
|
+ // irs = o.irs,
|
|
|
+ // imei = o.imei,
|
|
|
+ // gender = o.gender,
|
|
|
+ // graduate = o.graduate,
|
|
|
+ // hasEduOpenId = o.hasEduOpenId,
|
|
|
+ // guardians = o.guardians,
|
|
|
+ // });
|
|
|
+ // ret.AddRange(tmp);
|
|
|
+ //}
|
|
|
+
|
|
|
+ ////彙整沒有加入教室的學生
|
|
|
+ //notJoinClassStuds.ForEach(o => ret.Add(
|
|
|
+ // new
|
|
|
+ // {
|
|
|
+ // o.id,
|
|
|
+ // o.name,
|
|
|
+ // o.picture,
|
|
|
+ // o.year,
|
|
|
+ // o.no,
|
|
|
+ // classId = (string)null,
|
|
|
+ // classNo = (string)null,
|
|
|
+ // className = (string)null,
|
|
|
+ // gradeId = (string)null,
|
|
|
+ // o.periodId,
|
|
|
+ // classYear = -1,
|
|
|
+ // irs = o.irs,
|
|
|
+ // imei = o.imei,
|
|
|
+ // gender = o.gender,
|
|
|
+ // hasEduOpenId = o.hasEduOpenId,
|
|
|
+ // guardians = o.guardians,
|
|
|
+ // }));
|
|
|
+
|
|
|
+
|
|
|
return ret;
|
|
|
}
|
|
|
catch (Exception ex)
|