|
@@ -57,13 +57,13 @@ namespace TEAMModelAPI.Controllers
|
|
|
"periodId":"学段(选填)"
|
|
|
*/
|
|
|
/// <summary>
|
|
|
- /// 获取学校的行政班,教学班,教研组,研修名单
|
|
|
+ /// 名单列表信息 获取学校的行政班,教学班,教研组,研修名单
|
|
|
/// </summary>
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
[HttpPost("get-group-list")]
|
|
|
- [ApiToken(Auth = "1201", Name = "学校名单列表", RWN = "R", Limit = false)]
|
|
|
+ [ApiToken(Auth = "1201", Name = "名单列表信息", RWN = "R", Limit = false)]
|
|
|
public async Task<IActionResult> GetGroupList(JsonElement json)
|
|
|
{
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
@@ -157,9 +157,14 @@ namespace TEAMModelAPI.Controllers
|
|
|
groupLists = groupLists.Select(x => new { x.id, x.type, x.name, x.periodId, x.school, x.scope, x.year })
|
|
|
});
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 名单成员信息,学生成员信息,包含(学生,成员)基本信息,分组等信息
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="json"></param>
|
|
|
+ /// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
[HttpPost("get-group-members")]
|
|
|
- [ApiToken(Auth = "1202", Name = "获取名单详细信息和成员信息", RWN = "R", Limit = false)]
|
|
|
+ [ApiToken(Auth = "1202", Name = "名单成员信息", RWN = "R", Limit = false)]
|
|
|
public async Task<IActionResult> GetGroupMembers(JsonElement json)
|
|
|
{
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
@@ -314,7 +319,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
scope = "school",
|
|
|
school = school,
|
|
|
type = "teach",
|
|
|
- year = list.year,
|
|
|
+ year = list.year > 2000 ?DateTimeOffset.UtcNow.Year: groupList.year,
|
|
|
froms = 3
|
|
|
};
|
|
|
groupList = await GroupListService.CheckListNo(groupList, _azureCosmos, _dingDing, _option);
|
|
@@ -332,6 +337,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
groupList.school = school;
|
|
|
groupList.scope = "school";
|
|
|
groupList.froms = 3;
|
|
|
+ groupList.year = list.year > 2000 ? list.year : groupList.year;
|
|
|
await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync(groupList, groupList.id, new PartitionKey(groupList.code));
|
|
|
}
|
|
|
else
|
|
@@ -345,7 +351,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
scope = "school",
|
|
|
school = school,
|
|
|
type = "teach",
|
|
|
- year = list.year,
|
|
|
+ year = list.year > 2000 ? DateTimeOffset.UtcNow.Year : groupList.year,
|
|
|
froms = 3
|
|
|
};
|
|
|
groupList = await GroupListService.CheckListNo(groupList, _azureCosmos, _dingDing, _option);
|
|
@@ -363,7 +369,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return Ok(new { groupLists, errorData });
|
|
|
+ return Ok(new { groupLists=groupLists.Select(x=>new { x.name,x.no,x.periodId,x.school,x.type,x.year,x.tcount,x.scount,x.id}), errorData });
|
|
|
}
|
|
|
|
|
|
public class MemberImpt {
|
|
@@ -397,7 +403,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
- await _dingDing.SendBotMsg($"{_coreAPIHttpService.options.Get("Default").location}用户转换失败:{_coreAPIHttpService.options.Get("Default").url}{tmdstr}\n {ex.Message}\n{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
|
|
|
+ await _dingDing.SendBotMsg($"开放平台导入教学班 import-teach-members:{_coreAPIHttpService.options.Get("Default").location}用户转换失败:{_coreAPIHttpService.options.Get("Default").url}{tmdstr}\n {ex.Message}\n{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
|
|
|
//return Ok(new { error =3, msg = "醍摩豆ID验证错误!" });
|
|
|
}
|
|
|
var unexist_student = stus.Select(x => x.id).Except(students.Select(y => y.id));
|
|
@@ -436,7 +442,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return Ok(new { error = 2, msg = "名单错误!" });
|
|
|
+ return Ok(new { error = 2, msg = "名单不存在!" });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -494,7 +500,7 @@ namespace TEAMModelAPI.Controllers
|
|
|
return Ok(new { remove_stuids, remove_tmdids, list });
|
|
|
}
|
|
|
else {
|
|
|
- return Ok(new { error = 2, msg = "名单错误!" });
|
|
|
+ return Ok(new { error = 2, msg = "名单不存在!" });
|
|
|
}
|
|
|
}
|
|
|
else
|