|
@@ -180,7 +180,7 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
|
|
|
//入學學年為必須,故若是無給值則將之紀錄並跳過該筆資料
|
|
|
- if (student.TryGetProperty("year", out var tmpYear) && !string.IsNullOrWhiteSpace(tmpYear.GetString())) studentInfo.year = tmpYear.GetInt32();
|
|
|
+ if (student.TryGetProperty("year", out var tmpYear) && !string.IsNullOrWhiteSpace(Convert.ToString(tmpYear))) studentInfo.year = tmpYear.GetInt32();
|
|
|
else
|
|
|
{
|
|
|
errorYear.Add(id);
|
|
@@ -257,11 +257,13 @@ namespace TEAMModelOS.Controllers
|
|
|
Dictionary<string, List<(string id, string no)>> classStudNos = new Dictionary<string, List<(string id, string no)>>();
|
|
|
|
|
|
//Key:ClassNo Value:ClassId 存放教室no及id的變數
|
|
|
- Dictionary<string, (string classId, string className, string periodId, string gradeId)> classNoId = new Dictionary<string, (string classId, string className, string periodId, string gradeId)>();
|
|
|
+ Dictionary<string, (string classId, string className, string periodId, string gradeId, int year)> classNoId = new Dictionary<string, (string classId, string className, string periodId, string gradeId, int year)>();
|
|
|
foreach (var classInfo in classInfos)
|
|
|
{
|
|
|
+ string classGradeId = (classInfo.Value.TryGetProperty("gradeId", out JsonElement classGradeIdJson)) ? classGradeIdJson.GetString() : null;
|
|
|
+ int classYear = (classInfo.Value.TryGetProperty("year", out JsonElement classYearJson)) ? classYearJson.GetInt32() : 0;
|
|
|
classNoId.Add(classInfo.Key,
|
|
|
- (classInfo.Value.GetProperty("id").GetString(), classInfo.Value.GetProperty("name").GetString(), classInfo.Value.GetProperty("periodId").GetString(), classInfo.Value.GetProperty("gradeId").GetString()));
|
|
|
+ (classInfo.Value.GetProperty("id").GetString(), classInfo.Value.GetProperty("name").GetString(), classInfo.Value.GetProperty("periodId").GetString(), classGradeId, classYear));
|
|
|
tasks.Add(
|
|
|
Task.Run(
|
|
|
async () =>
|
|
@@ -297,10 +299,11 @@ namespace TEAMModelOS.Controllers
|
|
|
sortedImpData.classInfo[item].className,
|
|
|
item,
|
|
|
periodId,
|
|
|
- gradeId, year);
|
|
|
+ gradeId,
|
|
|
+ year);
|
|
|
|
|
|
classStudNos.Add(retCreateClassInfo.classNo, new List<(string id, string no)>());
|
|
|
- classNoId.Add(retCreateClassInfo.classNo, (retCreateClassInfo.classId, retCreateClassInfo.className, periodId, gradeId));
|
|
|
+ classNoId.Add(retCreateClassInfo.classNo, (retCreateClassInfo.classId, retCreateClassInfo.className, periodId, gradeId, year));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1825,12 +1828,12 @@ namespace TEAMModelOS.Controllers
|
|
|
courseCode = code.GetString();
|
|
|
}
|
|
|
string courseId = "";
|
|
|
- if (obj.TryGetProperty("courseCode", out var cosid))
|
|
|
+ if (obj.TryGetProperty("courseId", out var cosid))
|
|
|
{
|
|
|
courseId = cosid.GetString();
|
|
|
}
|
|
|
string stulistId = "";
|
|
|
- if (obj.TryGetProperty("courseCode", out var listId))
|
|
|
+ if (obj.TryGetProperty("id", out var listId))
|
|
|
{
|
|
|
stulistId = listId.GetString();
|
|
|
}
|