|
@@ -737,7 +737,7 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
if (isContinue) continue;
|
|
|
|
|
|
- (string id, string name, string pic, int year, string no, string classId, string classNo, string className, string gradeId, string periodId) tmpStudInfo
|
|
|
+ (string id, string name, string picture, int year, string no, string classId, string classNo, string className, string gradeId, string periodId) tmpStudInfo
|
|
|
= (stud.Key, stud.Value.name, null, stud.Value.year, stud.Value.no, null, stud.Value.classNo, null, null, null);
|
|
|
|
|
|
using var memoryStream = new MemoryStream();
|
|
@@ -830,7 +830,7 @@ namespace TEAMModelOS.SDK
|
|
|
student.salt = stud.Value.salt;
|
|
|
isUpPwDone = true;
|
|
|
}
|
|
|
- tmpStudInfo.pic = student.picture;
|
|
|
+ tmpStudInfo.picture = student.picture;
|
|
|
await cosmosContainer.ReplaceItemAsync(student, stud.Key, new PartitionKey($"Base-{schoolId}"));
|
|
|
|
|
|
}
|
|
@@ -852,7 +852,7 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
tmpStudInfo.id,
|
|
|
tmpStudInfo.name,
|
|
|
- tmpStudInfo.pic,
|
|
|
+ tmpStudInfo.picture,
|
|
|
tmpStudInfo.year,
|
|
|
tmpStudInfo.no,
|
|
|
tmpStudInfo.classId,
|
|
@@ -1038,7 +1038,7 @@ namespace TEAMModelOS.SDK
|
|
|
try
|
|
|
{
|
|
|
//以學校學生角度去抓資料
|
|
|
- List<(string id, string name, string pic, int year)> listStudent = new List<(string id, string name, string pic, int year)>();
|
|
|
+ List<(string id, string name, string picture, int year)> listStudent = new List<(string id, string name, string picture, int year)>();
|
|
|
string queryText = $"SELECT c.id, c.name, c.picture, c.year FROM c WHERE c.code = 'Base-{schoolId}'";
|
|
|
|
|
|
//如果有選擇ClassId的話,則先取得該教室內的學生。
|
|
@@ -1127,7 +1127,7 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
o.id,
|
|
|
o.name,
|
|
|
- o.pic,
|
|
|
+ o.picture,
|
|
|
o.year,
|
|
|
no = stud.GetProperty("no").GetString(),
|
|
|
gradeId = classroom.GetProperty("gradeId").GetString(),
|
|
@@ -1145,7 +1145,7 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
o.id,
|
|
|
o.name,
|
|
|
- o.pic,
|
|
|
+ o.picture,
|
|
|
o.year,
|
|
|
no = (string)null,
|
|
|
gradeId = (string)null,
|
|
@@ -1169,15 +1169,15 @@ namespace TEAMModelOS.SDK
|
|
|
/// 取得該學校的所有學生。
|
|
|
/// </summary>
|
|
|
/// <param name="schoolId"></param>
|
|
|
- /// <returns> [{id,name,pic,year,no,classId,classNo,className,gradeId,periodId},{id,name,pic,..}..]</returns>
|
|
|
+ /// <returns> [{id,name,picture,year,no,classId,classNo,className,gradeId,periodId},{id,name,picture,..}..]</returns>
|
|
|
public static async Task<List<object>> getAllStudent(AzureCosmosFactory _azureCosmos, DingDing _dingDing, Option _option, string schoolId)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
//TODO : 進階查詢選項調整、部分地方可用並行處理
|
|
|
//以學校學生角度去抓資料
|
|
|
- Dictionary<string, List<(string id, string name, string pic, int year, string no, string periodId, string irs)>> dicClassStuds = new Dictionary<string, List<(string id, string name, string pic, int year, string no, string periodId, string irs)>>();
|
|
|
- List<(string id, string name, string pic, int year, string no, string periodId, string irs)> notJoinClassStuds = new List<(string id, string name, string pic, int year, string no, string periodId, string irs)>();
|
|
|
+ Dictionary<string, List<(string id, string name, string picture, int year, string no, string periodId, string irs)>> dicClassStuds = new Dictionary<string, List<(string id, string name, string picture, int year, string no, string periodId, string irs)>>();
|
|
|
+ List<(string id, string name, string picture, int year, string no, string periodId, string irs)> notJoinClassStuds = new List<(string id, string name, string picture, int year, string no, string periodId, string irs)>();
|
|
|
|
|
|
string queryText = $"SELECT c.id, c.name, c.picture, c.year, c.classId, c.no,c.irs ,c.periodId FROM c WHERE c.code = 'Base-{schoolId}'";
|
|
|
|
|
@@ -1196,7 +1196,7 @@ namespace TEAMModelOS.SDK
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|
|
|
{
|
|
|
- List<(string id, string name, string pic, int year, string no)> students = new List<(string id, string name, string pic, int year, string no)>();
|
|
|
+ List<(string id, string name, string picture, int year, string no)> students = new List<(string id, string name, string picture, int year, string no)>();
|
|
|
|
|
|
var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
|
|
|
while (accounts.MoveNext())
|
|
@@ -1238,7 +1238,7 @@ namespace TEAMModelOS.SDK
|
|
|
else
|
|
|
{
|
|
|
dicClassStuds.Add(classId,
|
|
|
- new List<(string id, string name, string pic, int year, string no, string periodId, string irs)>()
|
|
|
+ new List<(string id, string name, string picture, int year, string no, string periodId, string irs)>()
|
|
|
{
|
|
|
(
|
|
|
acc.GetProperty("id").GetString(),
|
|
@@ -1286,7 +1286,7 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
o.id,
|
|
|
o.name,
|
|
|
- o.pic,
|
|
|
+ o.picture,
|
|
|
o.year,
|
|
|
o.no,
|
|
|
classId,
|
|
@@ -1307,7 +1307,7 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
o.id,
|
|
|
o.name,
|
|
|
- o.pic,
|
|
|
+ o.picture,
|
|
|
o.year,
|
|
|
o.no,
|
|
|
classId = (string)null,
|
|
@@ -1658,10 +1658,10 @@ namespace TEAMModelOS.SDK
|
|
|
|
|
|
//Key:id Value:學生基本資訊
|
|
|
var studentInfos
|
|
|
- = new Dictionary<string, (string salt, string pw, string name, int year, string pic, string gender, string mail, string mobile, string classId, string no, string periodId, string irs)>();
|
|
|
+ = new Dictionary<string, (string salt, string pw, string name, int year, string picture, string gender, string mail, string mobile, string classId, string no, string periodId, string irs)>();
|
|
|
//用於進行座號是否重複查詢時使用
|
|
|
var classStuds
|
|
|
- = new Dictionary<string, List<(string id, string salt, string pw, string name, int year, string pic, string gender, string mail, string mobile, string classId, string no, string periodId)>>();
|
|
|
+ = new Dictionary<string, List<(string id, string salt, string pw, string name, int year, string picture, string gender, string mail, string mobile, string classId, string no, string periodId)>>();
|
|
|
//紀錄教室"輸入"的學生座號是否有重複
|
|
|
var impClassDuplNo = new Dictionary<string, List<string>>();
|
|
|
//紀錄不存在的學生id
|
|
@@ -1745,11 +1745,11 @@ namespace TEAMModelOS.SDK
|
|
|
{
|
|
|
classStuds.Add(
|
|
|
classId,
|
|
|
- new List<(string id, string salt, string pw, string name, int year, string pic, string gender, string mail, string mobile, string classId, string no, string periodId)>()
|
|
|
+ new List<(string id, string salt, string pw, string name, int year, string picture, string gender, string mail, string mobile, string classId, string no, string periodId)>()
|
|
|
{ (id.GetString(), salt, pw, name, year, null, gender, null, null, classId, no,periodId) });
|
|
|
}
|
|
|
|
|
|
- //pic,mail,mobile暫不支持批量更新
|
|
|
+ //picture,mail,mobile暫不支持批量更新
|
|
|
studentInfos.Add(id.GetString(), (salt, pw, name, year, null, gender, null, null, classId, no, periodId, irs));
|
|
|
|
|
|
//先將id加進去後面再做刪除動作
|
|
@@ -1840,8 +1840,8 @@ namespace TEAMModelOS.SDK
|
|
|
account.TryGetProperty("irs", out JsonElement irsjson);
|
|
|
string irs = $"{irsjson}";
|
|
|
//用來記錄最後更改完的資料
|
|
|
- (string salt, string pw, string name, int year, string pic, string gender, string mail, string mobile, string classId, string no, string periodId, string irs) tmpData
|
|
|
- = (studentInfos[id].salt, studentInfos[id].pw, studentInfos[id].name, studentInfos[id].year, studentInfos[id].pic, studentInfos[id].gender, studentInfos[id].mail, studentInfos[id].mobile, studentInfos[id].classId, studentInfos[id].no, studentInfos[id].periodId, studentInfos[id].irs);
|
|
|
+ (string salt, string pw, string name, int year, string picture, string gender, string mail, string mobile, string classId, string no, string periodId, string irs) tmpData
|
|
|
+ = (studentInfos[id].salt, studentInfos[id].pw, studentInfos[id].name, studentInfos[id].year, studentInfos[id].picture, studentInfos[id].gender, studentInfos[id].mail, studentInfos[id].mobile, studentInfos[id].classId, studentInfos[id].no, studentInfos[id].periodId, studentInfos[id].irs);
|
|
|
|
|
|
bool isUpPwDone = false;
|
|
|
bool isWrong = false;
|
|
@@ -2014,7 +2014,7 @@ namespace TEAMModelOS.SDK
|
|
|
if (ret.Status == (int)HttpStatusCode.OK)
|
|
|
{
|
|
|
nonexistentIds.Remove(id);
|
|
|
- retStuds.Add(new { id, tmpData.name, tmpData.pic, tmpData.year, tmpData.no, classId, classNo, className, gradeId, periodId, tmpData.irs });
|
|
|
+ retStuds.Add(new { id, tmpData.name, tmpData.picture, tmpData.year, tmpData.no, classId, classNo, className, gradeId, periodId, tmpData.irs });
|
|
|
}
|
|
|
else errorIds.Add(id);
|
|
|
}
|