|
@@ -80,7 +80,7 @@ namespace TEAMModelOS.Controllers
|
|
[ProducesDefaultResponseType]
|
|
[ProducesDefaultResponseType]
|
|
[HttpPost("get-student-info")]
|
|
[HttpPost("get-student-info")]
|
|
[ApiToken(Auth = "1902", Name = "学生详细信息", TName = "學生詳細信息", EName = "Student Details", RWN = "R", Limit = false)]
|
|
[ApiToken(Auth = "1902", Name = "学生详细信息", TName = "學生詳細信息", EName = "Student Details", RWN = "R", Limit = false)]
|
|
- public async Task<IActionResult> GetLoginStuInfo(JsonElement jsonElement)
|
|
|
|
|
|
+ public async Task<IActionResult> GetLoginStuInfo(JsonElement jsonElement)
|
|
{
|
|
{
|
|
var (id, school) = HttpContext.GetApiTokenInfo();
|
|
var (id, school) = HttpContext.GetApiTokenInfo();
|
|
//if(!jsonElement.TryGetProperty("schoolId",out JsonElement schoolId)) return Ok(new { code = RespondCode.ParamsError, msg = "参数错误:schoolId", data = "" });
|
|
//if(!jsonElement.TryGetProperty("schoolId",out JsonElement schoolId)) return Ok(new { code = RespondCode.ParamsError, msg = "参数错误:schoolId", data = "" });
|
|
@@ -88,8 +88,10 @@ namespace TEAMModelOS.Controllers
|
|
return Ok(new { responseData });
|
|
return Ok(new { responseData });
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ #region 杉达公司
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 开课或者上传课例信息 是因支持VR/AR的公司
|
|
|
|
|
|
+ /// 开课或者上传课例信息 是因支持VR/AR的公司(杉达)
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="jsonElement"></param>
|
|
/// <param name="jsonElement"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
@@ -130,7 +132,7 @@ namespace TEAMModelOS.Controllers
|
|
}
|
|
}
|
|
else
|
|
else
|
|
lessonRecord.upload = 0;
|
|
lessonRecord.upload = 0;
|
|
- if (!string.IsNullOrEmpty($"{timLineJson}"))
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty($"{timLineJson}"))
|
|
{
|
|
{
|
|
timeLine = timLineJson.ToObject<TimeLine>();
|
|
timeLine = timLineJson.ToObject<TimeLine>();
|
|
lessonRecord.upload = 1;
|
|
lessonRecord.upload = 1;
|
|
@@ -278,12 +280,12 @@ namespace TEAMModelOS.Controllers
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|
|
await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} BizOverallEducation/UpLessonRec() 参数:bizId:{id},school:{school},json:{jsonElement.ToJsonString()} \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
await _dingDing.SendBotMsg($"OpenApi,{Environment.GetEnvironmentVariable("Option:Location")} BizOverallEducation/UpLessonRec() 参数:bizId:{id},school:{school},json:{jsonElement.ToJsonString()} \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
|
|
- return Ok(new { responseData= new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" } });
|
|
|
|
|
|
+ return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Error, msg = "服务端异常" } });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
- /// 获取学校课例 是因支持VR/AR的公司
|
|
|
|
|
|
+ /// 获取学校课例 是因支持VR/AR的公司(杉达)
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="jsonElement"></param>
|
|
/// <param name="jsonElement"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
@@ -301,13 +303,67 @@ namespace TEAMModelOS.Controllers
|
|
sql.Append($" and c.id='{lessId}'");
|
|
sql.Append($" and c.id='{lessId}'");
|
|
|
|
|
|
List<OLessonRecord> lessonRecords = new();
|
|
List<OLessonRecord> lessonRecords = new();
|
|
- await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS,"School").GetItemQueryIterator<OLessonRecord>(queryText:sql.ToString(),requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
|
|
|
|
|
|
+ await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<OLessonRecord>(queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{school}") }))
|
|
{
|
|
{
|
|
lessonRecords.Add(item);
|
|
lessonRecords.Add(item);
|
|
}
|
|
}
|
|
|
|
|
|
return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = lessonRecords } });
|
|
return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = lessonRecords } });
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 智音公司
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ ///
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="jsonElement"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [ProducesDefaultResponseType]
|
|
|
|
+ [HttpPost("set-stdent-score")]
|
|
|
|
+ [ApiToken(Auth = "1905", Name = "添加/修改学生艺术评测音乐答题结果", TName = "添加/修改學生藝術評測音樂答題結果", EName = "Add/modify the music answer results of student art evaluation", RWN = "R", Limit = false)]
|
|
|
|
+ public async Task<IActionResult> SetStudnetScore(JsonElement jsonElement)
|
|
|
|
+ {
|
|
|
|
+ var (id, school) = HttpContext.GetApiTokenInfo();
|
|
|
|
+
|
|
|
|
+ if (!jsonElement.TryGetProperty("oaswer", out JsonElement _oaswer)) return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.ParamsError, msg = "oaswer参数错误", data = null } });
|
|
|
|
+ OAnswerUp oAnswer = _oaswer.ToObject<OAnswerUp>();
|
|
|
|
+ StudentArtResult studentArtResult = new();
|
|
|
|
+ var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
|
+ var resArt = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync($"{school}-{oAnswer.studentId}", new PartitionKey($"ArtResult-{oAnswer.artId}"));
|
|
|
|
+ if (resArt.Status == 200)
|
|
|
|
+ {
|
|
|
|
+ JsonDocument jsonD = JsonDocument.Parse(resArt.Content);
|
|
|
|
+ studentArtResult = jsonD.RootElement.ToObject<StudentArtResult>();
|
|
|
|
+ var temp = studentArtResult.results.Find(f => f.Equals(oAnswer.thirdAnswerId));
|
|
|
|
+ temp.score = oAnswer.score;
|
|
|
|
+ temp.source = 1;
|
|
|
|
+ studentArtResult.oAnswer.questionId = oAnswer.questionId;
|
|
|
|
+ studentArtResult.oAnswer.thirdAnswerId = oAnswer.thirdAnswerId;
|
|
|
|
+ studentArtResult.oAnswer.score = oAnswer.score;
|
|
|
|
+ studentArtResult.oAnswer.detail = oAnswer.detail;
|
|
|
|
+
|
|
|
|
+ studentArtResult= await cosmosClient.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync<StudentArtResult>(studentArtResult, studentArtResult.id,new PartitionKey(studentArtResult.code));
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ return Ok(new { responseDate = new ResponseData<dynamic>() { code = RespondCode.NotFound, msg = "未找到活动相关学生答题信息", data = null } });
|
|
|
|
+
|
|
|
|
+ return Ok(new { responseData = new ResponseData<dynamic>() { code = RespondCode.Ok, msg = "成功", data = null } });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
///数据结构说明
|
|
///数据结构说明
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
@@ -318,10 +374,10 @@ X-Auth-ApiToken:授权token eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRz
|
|
Content-Type: application/json
|
|
Content-Type: application/json
|
|
params [body json]:
|
|
params [body json]:
|
|
{
|
|
{
|
|
- "schoolCode": "hbcn",
|
|
|
|
- "periodId": "463db08d-cbe7-48a0-a81a-fc39b3c1fep1",
|
|
|
|
- "subjectId": "subject_sport",
|
|
|
|
- "students": [
|
|
|
|
|
|
+"schoolCode": "hbcn",
|
|
|
|
+"periodId": "463db08d-cbe7-48a0-a81a-fc39b3c1fep1",
|
|
|
|
+"subjectId": "subject_sport",
|
|
|
|
+"students": [
|
|
{
|
|
{
|
|
"studentId": "202001001",
|
|
"studentId": "202001001",
|
|
"name": "卢三诗",
|
|
"name": "卢三诗",
|
|
@@ -348,11 +404,11 @@ params [body json]:
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+]
|
|
}
|
|
}
|
|
//正确返回
|
|
//正确返回
|
|
{
|
|
{
|
|
- "responseData": {
|
|
|
|
|
|
+"responseData": {
|
|
"code": 200,
|
|
"code": 200,
|
|
"msg": "成功",
|
|
"msg": "成功",
|
|
"data": {
|
|
"data": {
|
|
@@ -360,15 +416,15 @@ params [body json]:
|
|
"unmatchSemester":[],//如果数组长度大于0则,包含的学期信息不匹配
|
|
"unmatchSemester":[],//如果数组长度大于0则,包含的学期信息不匹配
|
|
"upsertDatas":[],//如果数组长度大于0则,表示更新或保存成功的数据
|
|
"upsertDatas":[],//如果数组长度大于0则,表示更新或保存成功的数据
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+}
|
|
}
|
|
}
|
|
//错误返回
|
|
//错误返回
|
|
{
|
|
{
|
|
- "responseData": {
|
|
|
|
|
|
+"responseData": {
|
|
"code": 500,
|
|
"code": 500,
|
|
"msg": "返回信息"
|
|
"msg": "返回信息"
|
|
|
|
|
|
- }
|
|
|
|
|
|
+}
|
|
}
|
|
}
|
|
code:
|
|
code:
|
|
500 服务端异常
|
|
500 服务端异常
|
|
@@ -381,10 +437,10 @@ code:
|
|
400 schoolCode为空
|
|
400 schoolCode为空
|
|
//接口规范
|
|
//接口规范
|
|
{
|
|
{
|
|
- "schoolCode": "hbcn", //学校简码
|
|
|
|
- "periodId": "52076c94-7581-fbae-4487-4b162a61fea3", //学段id
|
|
|
|
- "subjectId": "subject_sport", //体育科目id
|
|
|
|
- "students": [
|
|
|
|
|
|
+"schoolCode": "hbcn", //学校简码
|
|
|
|
+"periodId": "52076c94-7581-fbae-4487-4b162a61fea3", //学段id
|
|
|
|
+"subjectId": "subject_sport", //体育科目id
|
|
|
|
+"students": [
|
|
{
|
|
{
|
|
"studentId": "20220901", //学生编号
|
|
"studentId": "20220901", //学生编号
|
|
"name": "海献仪", //学生姓名
|
|
"name": "海献仪", //学生姓名
|
|
@@ -411,25 +467,25 @@ code:
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+]
|
|
}
|
|
}
|
|
//五育数据看板结构
|
|
//五育数据看板结构
|
|
{
|
|
{
|
|
- "id": "年份2021-学期id",
|
|
|
|
- "semesterName": "上学期",
|
|
|
|
- "year": 2021,
|
|
|
|
- "semesterId": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
|
|
- "code": "hbcn-20220901",
|
|
|
|
- "schoolCode": "hbcn",
|
|
|
|
- "studentId": "20220901",
|
|
|
|
- "name": "海献仪",
|
|
|
|
- "classId": [
|
|
|
|
|
|
+"id": "年份2021-学期id",
|
|
|
|
+"semesterName": "上学期",
|
|
|
|
+"year": 2021,
|
|
|
|
+"semesterId": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
|
|
+"code": "hbcn-20220901",
|
|
|
|
+"schoolCode": "hbcn",
|
|
|
|
+"studentId": "20220901",
|
|
|
|
+"name": "海献仪",
|
|
|
|
+"classId": [
|
|
"c406eee2-1ce9-caf4-5fc0-57351604b615"
|
|
"c406eee2-1ce9-caf4-5fc0-57351604b615"
|
|
- ],
|
|
|
|
- "periodId": "52076c94-7581-fbae-4487-4b162a61fea3",
|
|
|
|
- "grade": 1,
|
|
|
|
- "virtue": //德
|
|
|
|
- [
|
|
|
|
|
|
+],
|
|
|
|
+"periodId": "52076c94-7581-fbae-4487-4b162a61fea3",
|
|
|
|
+"grade": 1,
|
|
|
|
+"virtue": //德
|
|
|
|
+[
|
|
{
|
|
{
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"name": "评测名称",
|
|
"name": "评测名称",
|
|
@@ -447,9 +503,9 @@ code:
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- "intelligence": //智
|
|
|
|
- [
|
|
|
|
|
|
+],
|
|
|
|
+"intelligence": //智
|
|
|
|
+[
|
|
{
|
|
{
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"name": "评测名称",
|
|
"name": "评测名称",
|
|
@@ -458,9 +514,9 @@ code:
|
|
"examDate": 1629947402486,
|
|
"examDate": 1629947402486,
|
|
"level": 1
|
|
"level": 1
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- "sports": //体
|
|
|
|
- [
|
|
|
|
|
|
+],
|
|
|
|
+"sports": //体
|
|
|
|
+[
|
|
{
|
|
{
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"name": "评测名称",
|
|
"name": "评测名称",
|
|
@@ -477,9 +533,9 @@ code:
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- "art": //美
|
|
|
|
- [
|
|
|
|
|
|
+],
|
|
|
|
+"art": //美
|
|
|
|
+[
|
|
{
|
|
{
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"name": "评测名称",
|
|
"name": "评测名称",
|
|
@@ -488,9 +544,9 @@ code:
|
|
"examDate": 1629947402486,
|
|
"examDate": 1629947402486,
|
|
"level": 1,
|
|
"level": 1,
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- "labour": //劳
|
|
|
|
- [
|
|
|
|
|
|
+],
|
|
|
|
+"labour": //劳
|
|
|
|
+[
|
|
{
|
|
{
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"id": "17f85c96-253d-4f84-84ad-c819f0b605s2",
|
|
"name": "任务名称",
|
|
"name": "任务名称",
|
|
@@ -505,9 +561,9 @@ code:
|
|
}
|
|
}
|
|
]
|
|
]
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+]
|
|
}
|
|
}
|
|
-* **/
|
|
|
|
|
|
+ * **/
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|