123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155 |
- using Microsoft.Azure.Cosmos;
- using DinkToPdf.Contracts;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Configuration;
- using Microsoft.Extensions.Options;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.Json;
- using System.Threading.Tasks;
- using System.Web;
- using TEAMModelOS.Filter;
- using TEAMModelOS.Models;
- using TEAMModelOS.SDK;
- using TEAMModelOS.SDK.DI;
- using TEAMModelOS.SDK.Extension;
- using TEAMModelOS.SDK.Models;
- using TEAMModelOS.SDK.Models.Cosmos;
- using TEAMModelOS.SDK.Models.Cosmos.Student;
- namespace TEAMModelOS.Controllers.Common
- {
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status400BadRequest)]
- [Route("common/art")]
- [ApiController]
- public class ArtController : ControllerBase
- {
- private readonly AzureCosmosFactory _azureCosmos;
- private readonly SnowflakeId _snowflakeId;
- private readonly AzureServiceBusFactory _serviceBus;
- private readonly DingDing _dingDing;
- private readonly Option _option;
- private readonly AzureStorageFactory _azureStorage;
- private readonly AzureRedisFactory _azureRedis;
- private readonly IConverter _converter;
- public IConfiguration _configuration { get; set; }
- private readonly CoreAPIHttpService _coreAPIHttpService;
- public ArtController(IConverter converter, CoreAPIHttpService coreAPIHttpService, AzureCosmosFactory azureCosmos, AzureServiceBusFactory serviceBus, SnowflakeId snowflakeId, DingDing dingDing,
- IOptionsSnapshot<Option> option, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, IConfiguration configuration)
- {
- _coreAPIHttpService = coreAPIHttpService;
- _azureCosmos = azureCosmos;
- _serviceBus = serviceBus;
- _snowflakeId = snowflakeId;
- _dingDing = dingDing;
- _option = option?.Value;
- _azureStorage = azureStorage;
- _azureRedis = azureRedis;
- _configuration = configuration;
- _converter = converter;
- }
- /// <summary>
- /// 保存艺术评价信息
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [ProducesDefaultResponseType]
- [AuthToken(Roles = "teacher,admin")]
- [HttpPost("save")]
- [Authorize(Roles = "IES")]
- public async Task<IActionResult> Save(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("art", out JsonElement art)) return BadRequest();
- var client = _azureCosmos.GetCosmosClient();
- ArtEvaluation ae = art.ToObject<ArtEvaluation>();
- bool flag = false;
- ArtMusic music = new();
- if (request.TryGetProperty("ArtMusic", out JsonElement am))
- {
- music = am.ToObject<ArtMusic>();
- music.ttl = -1;
- music.code = "ArtMusic";
- flag = true;
- };
- var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
- string code = ae.school;
- ae.ttl = -1;
- ae.progress = "going";
- ae.creatorId = userid;
- if (!ae.owner.Equals("area"))
- {
- ae.owner = "school";
- ae.code = "Art-" + code;
- ae.scope = "school";
- long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
- ae.createTime = now;
- ae.publish = 0;
- }
- if (string.IsNullOrEmpty(ae.id))
- {
- ae.id = Guid.NewGuid().ToString();
- await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(ae, new PartitionKey($"{ae.code}"));
- if (flag)
- {
- music.id = ae.id;
- await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(music, new PartitionKey("ArtMusic"));
- }
- }
- else
- {
- if (flag)
- {
- await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(music, music.id, new PartitionKey("ArtMusic"));
- }
- await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(ae, ae.id, new PartitionKey($"{ae.code}"));
- }
- return Ok(new { ae });
- }
- catch (Exception ex)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/save()\n{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500, msg = ex.Message });
- }
- }
- [ProducesDefaultResponseType]
- [AuthToken(Roles = "teacher,admin,student")]
- [HttpPost("update-state")]
- [Authorize(Roles = "IES")]
- public async Task<IActionResult> UpdateState(JsonElement request)
- {
- var client = _azureCosmos.GetCosmosClient();
- try
- {
- if (!request.TryGetProperty("id", out JsonElement stuId)) return BadRequest();
- if (!request.TryGetProperty("artId", out JsonElement artId)) return BadRequest();
- if (!request.TryGetProperty("isAnswer", out JsonElement isAnswer)) return BadRequest();
- var (userid, name, picture, school) = HttpContext.GetAuthTokenInfo();
- HttpContext.Items.TryGetValue("Scope", out object scope);
- int userType = $"{scope}".Equals(Constant.ScopeStudent) ? 2 : 1;
- StudentArtResult artResult = null;
- //long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
- var res = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(stuId.ToString(), new PartitionKey($"ArtResult-{artId}"));
- if (res.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(res.Content);
- artResult = json.ToObject<StudentArtResult>();
- //artResult.isAnswer = isAnswer.GetInt32();
- await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(artResult, artResult.id, new PartitionKey($"{artResult.code}"));
- }
- return Ok();
- }
- catch (Exception e)
- {
- return BadRequest(new { msg = e.Message });
- }
- }
- [ProducesDefaultResponseType]
- [AuthToken(Roles = "teacher,admin,student")]
- [HttpPost("upload")]
- [Authorize(Roles = "IES")]
- public async Task<IActionResult> Upload(ArtRecord request)
- {
- try
- {
- var client = _azureCosmos.GetCosmosClient();
- var (userid, name, picture, school) = HttpContext.GetAuthTokenInfo();
- HttpContext.Items.TryGetValue("Scope", out object scope);
- int userType = $"{scope}".Equals(Constant.ScopeStudent) ? 2 : 1;
- request.school = school;
- request.stuId = userid;
- request.code = "ArtRecord";
- long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
- request.createTime = now;
- ArtRecord record;
- StudentArtResult artResult;
- ArtEvaluation art;
- List<string> classIds = new();
- List<GroupListGrp> groups = await GroupListService.GetMemberInGroupList(_coreAPIHttpService, client, _dingDing, userid, userType, school, new List<string> { "class", "teach" });
- foreach (var grp in groups)
- {
- classIds.Add(grp.id);
- }
- /* if (string.IsNullOrEmpty(request.id))
- {
- request.id = Guid.NewGuid().ToString();
- record = await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(request, new PartitionKey($"{request.code}"));
- }
- else
- {
- record = await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(request, request.id, new PartitionKey($"{request.code}"));
- }*/
- string rId = string.Format("{0}{1}{2}", request.school, "-", userid);
- //首先根据大ID获取整个活动得内容
- var aresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(request.artId, new PartitionKey($"Art-{school}"));
- if (aresponse.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(aresponse.Content);
- art = json.ToObject<ArtEvaluation>();
- var response = await client.GetContainer("TEAMModelOS", "Student").ReadItemStreamAsync(rId, new PartitionKey($"ArtResult-{request.artId}"));
- if (response.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json_1 = await JsonDocument.ParseAsync(response.Content);
- artResult = json_1.ToObject<StudentArtResult>();
- List<Attachment> files = new();
- files = request.attachments;
- //bool flage = artResult.results.Exists(a => a.taskId == request.acId);
- artResult.results.ForEach(a =>
- {
- if (a.taskId == request.acId)
- {
- a.files = files;
- }
- });
- await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(artResult, artResult.id, new PartitionKey($"{artResult.code}"));
- }
- else
- {
- artResult = new StudentArtResult
- {
- id = rId,
- pk = "ArtResult",
- code = $"ArtResult-{request.artId}",
- studentId = userid,
- picture = picture,
- studentName = name,
- school = school,
- userType = userType,
- artId = request.artId,
- classIds = classIds
- };
- foreach (var qIds in art.settings)
- {
- foreach (var task in qIds.task)
- {
- ArtQuotaResult quotaResult = new()
- {
- quotaId = qIds.id,
- quotaName = qIds.quotaname,
- quotaType = (int)task.type,
- subjectId = task.subject,
- taskId = task.acId
- };
- if (!string.IsNullOrEmpty(quotaResult.taskId))
- {
- if (quotaResult.taskId.Equals(request.acId))
- {
- quotaResult.files = request.attachments;
- }
- }
- artResult.results.Add(quotaResult);
- }
- }
- await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(artResult, new PartitionKey($"{artResult.code}"));
- }
- }
- return Ok(new { code = 200 });
- }
- catch (Exception ex)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/upload()\n{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500, msg = ex.Message });
- }
- }
- [ProducesDefaultResponseType]
- [AuthToken(Roles = "teacher,admin,student")]
- [HttpPost("upload-all")]
- [Authorize(Roles = "IES")]
- public async Task<IActionResult> UploadAll(JsonElement element)
- {
- try
- {
- var client = _azureCosmos.GetCosmosClient();
- if (!element.TryGetProperty("stus", out JsonElement stus)) return BadRequest();
- List<stuFiles> stuFiles = stus.ToObject<List<stuFiles>>();
- List<string> value = new List<string>();
- await foreach (var s in stuTask(stuFiles, client))
- {
- if (s.code == 1)
- {
- value.Add(s.value);
- }
- }
- if (value.Count > 0)
- {
- return Ok(new { code = 1, msg = "学生ID导入异常", value = value });
- }
- else
- {
- return Ok(new { code = 0 });
- }
- }
- catch (Exception ex)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/uploadAll()\n{ex.Message}\n{ex.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500, msg = ex.Message });
- }
- }
- private async IAsyncEnumerable<(int code, string value)> stuTask(List<stuFiles> stuFiles, CosmosClient client)
- {
- foreach (var files in stuFiles)
- {
- string value = "";
- int code = 0;
- try
- {
- if (string.IsNullOrEmpty(files.id))
- {
- ArtAttachment attachment = new()
- {
- id = Guid.NewGuid().ToString(),
- artId = files.artId,
- achievement = files.achievement,
- address = files.address,
- studentId = files.studentId,
- taskId = files.taskId,
- subjectId = files.subjectId,
- quotaId = files.quotaId,
- quotaName = files.quotaName,
- uploadName = files.uploadName,
- uploadTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
- duration = files.duration,
- name = files.name,
- des = files.des,
- artType = files.artType,
- level = files.level,
- files = files.files,
- ttl = -1,
- code = "ArtAttachment-" + files.school
- };
- await client.GetContainer("TEAMModelOS", "Student").CreateItemAsync(attachment, new PartitionKey($"{attachment.code}"));
- }
- else
- {
- ArtAttachment attachment = new()
- {
- artId = files.artId,
- achievement = files.achievement,
- address = files.address,
- studentId = files.studentId,
- taskId = files.taskId,
- subjectId = files.subjectId,
- quotaId = files.quotaId,
- quotaName = files.quotaName,
- updateTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
- uploadName = files.uploadName,
- duration = files.duration,
- name = files.name,
- des = files.des,
- artType = files.artType,
- level = files.level,
- files = files.files,
- ttl = -1,
- code = "ArtAttachment-" + files.school
- };
- await client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync(attachment, attachment.id, new PartitionKey($"{attachment.code}"));
- }
- }
- catch (Exception e)
- {
- value = files.studentId;
- code = 1;
- }
- yield return (code, value);
- }
- }
- [ProducesDefaultResponseType]
- [AuthToken(Roles = "teacher,admin")]
- [HttpPost("delete")]
- [Authorize(Roles = "IES")]
- public async Task<IActionResult> Delete(JsonElement request)
- {
- try
- {
- //object userScope = null;
- //object _standard = null;
- if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
- if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
- /* string standard = null;
- HttpContext?.Items?.TryGetValue("Scope", out userScope);
- if (userScope != null && $"{userScope}".Equals(Constant.ScopeTeacher))
- {
- HttpContext?.Items?.TryGetValue("Standard", out _standard);
- standard = _standard != null && string.IsNullOrEmpty($"{userScope}") ? _standard.ToString() : null;
- }*/
- var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
- var client = _azureCosmos.GetCosmosClient();
- //TODO 区级活动的联动删除评测活动
- var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"Art-{code}"));
- if (sresponse.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(sresponse.Content);
- ArtEvaluation art = json.ToObject<ArtEvaluation>();
- //必须是本人或者这个学校的管理者才能删除
- bool flag = false;
- if (art.creatorId == userid)
- {
- flag = true;
- }
- else
- {
- if (art.scope == "school" && art.school.Equals(school))
- {
- flag = true;
- }
- }
- /*try
- {
- (List<RMember> members, List<RGroupList> groups) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, null, art.school, null);
- await StatisticsService.DoChange(new TeacherTrainChange
- { standard = standard, tmdids = members.Select(x => x.id)?.ToList(), school = art.school, update = new HashSet<string> { StatisticsService.OfflineRecord }, statistics = 0 }, _azureCosmos);
- }
- catch (Exception ex)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/delete()ex\n{ex.Message}\n{ex.StackTrace},\n", GroupNames.醍摩豆服務運維群組);
- }*/
- if (flag)
- {
- art.status = 404;
- foreach (var info in art.settings)
- {
- /* if (info.TryGetProperty("examId", out JsonElement eId)) {
- }*/
- foreach (var acs in info.task)
- {
- if (!string.IsNullOrEmpty(acs.acId))
- {
- if (acs.type == 1)
- {
- ResponseMessage response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(acs.acId, new PartitionKey($"Exam-{code}"));
- if (response.StatusCode==System.Net.HttpStatusCode.OK)
- {
- ExamInfo data = JsonDocument.Parse(response.Content).RootElement.Deserialize<ExamInfo>();
- data.status = 404;
- await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(data, data.id, new PartitionKey($"Exam-{code}"));
- }
- }
- }
- }
- }
- await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync(art, art.id, new PartitionKey($"{art.code}"));
- //如果是区级活动删除 先查询该区下面所有的艺术评测ID集合
- if (art.publish == 0)
- {
- List<string> artIds = new();
- string sql = $"select c.id from c where c.pId = '{art.pId}'";
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Common).GetItemQueryStreamIteratorSql
- (queryText: sql))
- {
- using var sjson = await JsonDocument.ParseAsync(item.Content);
- if (sjson.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in sjson.RootElement.GetProperty("Documents").EnumerateArray())
- {
- if (obj.TryGetProperty("id", out JsonElement subScore))
- {
- string sId = obj.GetProperty("id").GetString();
- artIds.Add(sId);
- }
- }
- }
- }
- foreach (string artId in artIds)
- {
- await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(artId, new PartitionKey("ArtMusic"));
- await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(artId, new PartitionKey("ArtExam"));
- }
- /*string queryScore = $" select c.id from c where c.artId in ({string.Join(",", artIds.Select(o => $"'{o}'"))})";
- List<string> ids = new();
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIteratorSql
- (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))
- {
- using var sjson = await JsonDocument.ParseAsync(item.Content);
- if (sjson.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in sjson.RootElement.GetProperty("Documents").EnumerateArray())
- {
- if (obj.TryGetProperty("id", out JsonElement subScore))
- {
- string sId = obj.GetProperty("id").GetString();
- ids.Add(sId);
- }
- }
- }
- }
- await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");*/
- }
- else
- {
- /* string queryScore = $" select c.id from c where c.artId = '{art.id})'";
- List<string> ids = new();
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryStreamIteratorSql
- (queryText: queryScore, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("ArtRecord") }))
- {
- using var sjson = await JsonDocument.ParseAsync(item.Content);
- if (sjson.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in sjson.RootElement.GetProperty("Documents").EnumerateArray())
- {
- if (obj.TryGetProperty("id", out JsonElement subScore))
- {
- string sId = obj.GetProperty("id").GetString();
- ids.Add(sId);
- }
- }
- }
- }
- await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemsAsync<ArtRecord>(ids, "ArtRecord");*/
- await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(art.id, new PartitionKey("ArtMusic"));
- }
- }
- }
- return Ok(new { id });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/delete()\n{e.Message}\n{e.StackTrace},\n", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- /// <param name="request"></param>
- /// <returns></returns>
- [ProducesDefaultResponseType]
- [Authorize(Roles = "IES")]
- [AuthToken(Roles = "teacher,admin")]
- [HttpPost("find")]
- public async Task<IActionResult> Find(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
- request.TryGetProperty("periodId", out JsonElement period);
- request.TryGetProperty("periodType", out JsonElement periodType);
- if (string.IsNullOrWhiteSpace($"{period}") && string.IsNullOrWhiteSpace($"{periodType}"))
- {
- return BadRequest();
- }
- var client = _azureCosmos.GetCosmosClient();
- StringBuilder stringBuilder = new($"select c.id,c.img,c.name,c.classes,c.code,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress,c.uploadSTime,c.uploadETime,c.examDeadline from c where (c.status<>404 or IS_DEFINED(c.status) = false )");
- string continuationToken = string.Empty;
- string token = default;
-
- if (!string.IsNullOrWhiteSpace($"{period}") && !string.IsNullOrWhiteSpace($"{periodType}"))
- {
- stringBuilder.Append($" and (c.period.id = '{period}' or c.periodType = '{periodType}')");
- }
- if (string.IsNullOrWhiteSpace($"{period}") && !string.IsNullOrWhiteSpace($"{periodType}"))
- {
- stringBuilder.Append($" and c.periodType = '{periodType}' ");
- }
- if (!string.IsNullOrWhiteSpace($"{period}") && string.IsNullOrWhiteSpace($"{periodType}"))
- {
- stringBuilder.Append($" and c.period.id = '{period}' ");
- }
- //开始时间,
- if (request.TryGetProperty("stime", out JsonElement stime))
- {
- if (long.TryParse($"{stime}", out long data))
- {
- stringBuilder.Append($" and c.createTime >= {data} ");
- };
- };
- //默认当前时间
- if (request.TryGetProperty("etime", out JsonElement etime))
- {
- if (long.TryParse($"{etime}", out long data))
- {
- stringBuilder.Append($" and c.createTime <= {data} ");
- };
- };
- stringBuilder.Append("order by c.createTime desc");
- //是否需要进行分页查询,默认不分页
- bool iscontinuation = false;
- if (request.TryGetProperty("token", out JsonElement token_1))
- {
- token = token_1.GetString();
- iscontinuation = true;
- };
- //默认不指定返回大小
- int? topcout = null;
- if (request.TryGetProperty("count", out JsonElement jcount))
- {
- if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
- {
- topcout = data;
- }
- }
- List<ArtEvaluation> arts = new();
- await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIteratorSql(queryText: stringBuilder.ToString(), continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Art-{code}") }))
- {
- using var json = await JsonDocument.ParseAsync(item.Content);
- if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
- {
- arts.Add(obj.ToObject<ArtEvaluation>());
- }
- }
- if (iscontinuation)
- {
- continuationToken = item.ContinuationToken;
- break;
- }
- }
- arts = arts.Where((x, i) => arts.FindIndex(z => z.id == x.id) == i).ToList();
- return Ok(new { arts });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/find()\n{e.Message}\n{e.StackTrace}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- [ProducesDefaultResponseType]
- [Authorize(Roles = "IES")]
- [AuthToken(Roles = "teacher,admin,student")]
- [HttpPost("find-summary")]
- public async Task<IActionResult> FindSummary(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
- if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
- var client = _azureCosmos.GetCosmosClient();
- ArtEvaluation art = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ArtEvaluation>(id.GetString(), new PartitionKey($"Art-{code}"));
- if (art.owner.Equals("area") && string.IsNullOrEmpty(art.pId))
- {
- }
- else
- {
- List<(string eId, string sId)> ids = new();
- var examId = art.settings.SelectMany(x => x.task).Where(c => c.type == 1).Select(z => new { z.acId, z.subject }).ToList();
- examId.ForEach(x =>
- {
- ids.Add((x.acId, x.subject));
- });
- List<(string scode, string sub, List<string> stu)> stuInfo = await getLostAsync(ids, client, art.school);
- List<string> stus = new();
- foreach (var (scode, sub, stu) in stuInfo)
- {
- if (stus.Count == 0)
- {
- stus = stus.Union(stu).ToList();
- }
- else
- {
- stus = stus.Intersect(stu).ToList();
- }
- LostStudent lostStudent = new()
- {
- code = scode,
- subject = sub,
- stu = stu.Count
- };
- art.lost.Add(lostStudent);
- }
- art.miss.Add(stus.Count);
- }
- //art.miss = stus.Count;
- //art.pass = 1;
- //await client.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ArtEvaluation>(art, art.id, new PartitionKey(art.code));
- ArtMusic music = new();
- ArtExam ae = new();
- if (art != null)
- {
- string queryArtExam = $" select value(c) from c where c.activityId = '{art.pId}' ";
- //List<ArtExam> aes = new List<ArtExam>();
- /* await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Common).GetItemQueryIteratorSql<ArtExam>
- (queryText: queryArtExam, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtExam") }))
- {
- aes.Add(item);
- }*/
- if (!string.IsNullOrWhiteSpace(art.pId))
- {
- var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(art.pId, new PartitionKey("ArtMusic"));
- var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(art.pId, new PartitionKey("ArtExam"));
- if (sresponse.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(sresponse.Content);
- ae = json.ToObject<ArtExam>();
- }
- if (response.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(response.Content);
- music = json.ToObject<ArtMusic>();
- }
- }
- else
- {
- var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(art.id, new PartitionKey("ArtMusic"));
- if (response.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(response.Content);
- music = json.ToObject<ArtMusic>();
- }
- }
- (List<RMember> rmembers, List<RGroupList> groups) = await GroupListService.GetMemberByListids(_coreAPIHttpService, client, _dingDing, art.classes, art.school,null,-1,art.startTime);
- var classes = art.classes.Select(c => new
- {
- id = c,
- groups.Where(g => g.id.Equals(c)).FirstOrDefault()?.name
- });
- rmembers.ForEach(x =>
- {
- groups.ForEach(z =>
- {
- if (z.members.Exists(y => y.id.Equals(x.id) && y.type == x.type))
- {
- x.groupListIds.Add(z.id);
- }
- });
- });
- List<ArtSubjectScore> subjectScores = new List<ArtSubjectScore>();
- art.subjects.ForEach(z => { subjectScores.Add(new ArtSubjectScore { subjectId = z.id, score = 0 }); });
- var students = rmembers.Select(z => new StudentArtResult
- {
- studentId = z.id,
- studentName = z.name,
- userType = z.type,
- classIds = z.groupListIds,
- school = z.schoolId,
- picture = z.picture,
- artId = $"{id}",
- id = $"{z.schoolId}-{z.id}",
- code = $"ArtResult-{id}",
- pk = "ArtResult",
- ttl = -1,
- subjectScores = subjectScores,
- }).ToList();
- //TODO 缺考人数的结算(多科评量检测,作业的提交)
- if (students.Any())
- {
- string query = $" select value c.id from c where c.id in({string.Join(",", students.Select(x => $"'{x.id}'"))}) ";
- List<string> list = new List<string>();
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, Constant.Student).GetItemQueryIteratorSql<string>
- (queryText: query, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtResult-{id}") }))
- {
- list.Add(item);
- }
- students.RemoveAll(x => list.Contains(x.id));
- students.ForEach(x =>
- {
- art.settings.ForEach(a =>
- {
- a.task.ForEach(z =>
- {
- ArtQuotaResult quotaResult = new ArtQuotaResult
- {
- taskId = z.acId,
- subjectId = z.subject,
- quotaId = a.id,
- quotaType = z.type.Value,
- quotaName = a.quotaname
- };
- x.results.Add(quotaResult);
- });
- });
- });
- List<Task<ItemResponse<StudentArtResult>>> responses = new();
- students.ForEach(z =>
- {
- responses.Add(client.GetContainer(Constant.TEAMModelOS, Constant.Student).CreateItemAsync(z, new PartitionKey(z.code)));
- });
- if (responses.Count > 0)
- {
- await responses.TaskPage(10);
- }
- }
- if (!string.IsNullOrWhiteSpace(ae.id))
- {
- return Ok(new { art, classes, ae, music, count = rmembers.Count, code = 200 });
- }
- else
- {
- return Ok(new { art, classes, music, count = rmembers.Count, code = 200 });
- }
- }
- else
- {
- return Ok(new { art, code = 404 });
- }
- }
- catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
- {
- return Ok(new { code = 404 });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/FindSummary()\n{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- public static async Task<List<(string code, string subject, List<string> stus)>> getLostAsync(List<(string eId, string sId)> examIds, CosmosClient client, string code)
- {
- List<(string code, string sub, List<string> stu)> stuInfo = new();
- if (examIds.Any())
- {
- string examSql = $"select c.id,c.school,c.lostStu from c where c.id in ({string.Join(",", examIds.Select(o => $"'{o.eId}'"))})";
- await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIteratorSql(queryText: examSql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Exam-{code}") }))
- {
- 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 account = accounts.Current;
- List<string> lostStu = account.GetProperty("lostStu").ToObject<List<string>>();
- string id = account.GetProperty("id").GetString();
- string sub = examIds.Where(c => c.eId.Equals(id)).FirstOrDefault().sId;
- stuInfo.Add((account.GetProperty("school").GetString(), sub, lostStu));
- }
- }
- }
- }
- return stuInfo;
- }
- [ProducesDefaultResponseType]
- [Authorize(Roles = "IES")]
- [AuthToken(Roles = "teacher,admin,student")]
- [HttpPost("find-summary-by-student")]
- public async Task<IActionResult> findByStudent(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
- if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
- var client = _azureCosmos.GetCosmosClient();
- var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
- ArtEvaluation art = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ArtEvaluation>(id.GetString(), new PartitionKey($"Art-{code}"));
- ArtMusic music = new();
- if (art != null)
- {
- //List<StuActivity> stus = new();
- List<studentInfos> stus = new();
- List<string> wIds = new();
- List<StudentArtResult> works = new();
- if (!string.IsNullOrWhiteSpace(art.pId))
- {
- var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(art.pId, new PartitionKey("ArtMusic"));
- if (response.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(response.Content);
- music = json.ToObject<ArtMusic>();
- }
- }
- else
- {
- var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(art.id, new PartitionKey("ArtMusic"));
- if (response.StatusCode==System.Net.HttpStatusCode.OK)
- {
- using var json = await JsonDocument.ParseAsync(response.Content);
- music = json.ToObject<ArtMusic>();
- }
- }
- var taskType1 = art.settings.SelectMany(z => z.task).Where(t => t.type == 1);
- //wIds = art.settings.SelectMany(z => z.task).Where(t => t.type == 2).Select(a => a.acId).ToList();
- if (taskType1 != null && taskType1.Any())
- {
- List<ExamClassResult> examClassResults = new();
- //string sql = $"select value(c) from c where c.examId in ({string.Join(",", taskType1.Select(z => $"'{z.acId}'"))})' and c.pk = 'ExamClassResult' and array_contains(c.studentIds,'{userid}')";
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIteratorSql<ExamClassResult>(
- queryText: $"select value(c) from c where c.examId in ({string.Join(",", taskType1.Select(z => $"'{z.acId}'"))}) and c.pk = 'ExamClassResult' and array_contains(c.studentIds,'{userid}')"))
- {
- examClassResults.Add(item);
- }
- foreach (ExamClassResult classResult in examClassResults)
- {
- int index = classResult.studentIds.IndexOf(userid);
- if (index != -1)
- {
- studentInfos infos = new()
- {
- id = classResult.examId,
- paper = classResult.paper[index],
- subject = classResult.subjectId
- };
- stus.Add(infos);
- }
- }
- }
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIteratorSql<StudentArtResult>(
- queryText: $"select value(c) from c where c.id = '{code}-{userid}'",
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ArtResult-{id}") }))
- {
- works.Add(item);
- }
- return Ok(new { art, stus, works, music, code = 200 });
- }
- else
- {
- return Ok(new { art, code = 404 });
- }
- }
- catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
- {
- return Ok(new { code = 404 });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/find-summary-by-student()\n{e.Message}\n{e.StackTrace}\n{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- [ProducesDefaultResponseType]
- [Authorize(Roles = "IES")]
- [AuthToken(Roles = "teacher,admin")]
- [HttpPost("find-summary-by-work")]
- public async Task<IActionResult> findBywork(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
- if (!request.TryGetProperty("subject", out JsonElement subject)) return BadRequest();
- //艺术评测ID
- if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
- if (!request.TryGetProperty("taskId", out JsonElement taskId)) return BadRequest();
- string token = HttpContext.GetXAuth("authtoken");
- var client = _azureCosmos.GetCosmosClient();
- var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
- List<StudentArtResult> artResults = new();
- string sql = $"select value(c) from c where c.artId = '{id}' and array_contains(c.classIds,'{classId}') ";
- await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIteratorSql(
- queryText: sql,
- requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ArtResult-{id}") }))
- {
- using var json = await JsonDocument.ParseAsync(item.Content);
- if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
- {
- artResults.Add(obj.ToObject<StudentArtResult>());
- }
- }
- }
- artResults.ForEach(x => x.results.RemoveAll(z => !string.IsNullOrWhiteSpace(z.subjectId) && !subject.GetString().Equals(z.subjectId)));
- artResults.ForEach(x => x.subjectScores.RemoveAll(z => !string.IsNullOrWhiteSpace(z.subjectId) && !subject.GetString().Equals(z.subjectId)));
- List<ArtAttachment> artAttachments = new();
- string sqlTask = $"select value(c) from c where c.artId = '{id}' and c.subjectId = '{subject}'";
- await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).
- GetItemQueryIteratorSql<ArtAttachment>(queryText: sqlTask, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"ArtAttachment-{school}") }))
- {
- artAttachments.Add(item);
- }
- List<(string stuId, string url, long time)> zyUrl = new();
- foreach (StudentArtResult artResult in artResults)
- {
- if (!string.IsNullOrWhiteSpace(artResult.zyanswer.thirdAnswerId))
- {
- var data = new { busType = "aqd", artResult.zyanswer.thirdAnswerId };
- //byte[] inputBytes = Encoding.UTF8.GetBytes(artResult.zyanswer.thirdAnswerId);
- //string base64Str = Convert.ToBase64String(inputBytes);
- var base64Str = HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.UTF8.GetBytes(data.ToJsonString())));
- //var date = Convert.FromBase64String(base64Str);
- StringBuilder url = new("https://musicopen.winteach.cn?appid=8a68f563f3384662acbc268336b98ae2");
- url.Append($"&data={base64Str}");
- url.Append($"&thirdToken={token}");
- zyUrl.Add((artResult.studentId, url.ToString(), artResult.zyanswer.time));
- }
- else
- {
- zyUrl.Add((artResult.studentId, string.Empty, 0));
- }
- }
- //if (string.IsNullOrWhiteSpace(artResult.zyanswer.thirdAnswerId)) { }
- if (subject.GetString().Equals("subject_music"))
- {
- var works = artResults.Select(x => new
- {
- stuId = x.studentId,
- x.studentName,
- x.classIds,
- x.artId,
- isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
- attachments = artAttachments.Count > 0 ?artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList() : null,
- url = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().url : "",
- time = x.results.Where(c => c.taskId.Equals(taskId.GetString())).FirstOrDefault().quotaId.Equals("quota_22") ? zyUrl.Where(c => c.stuId.Equals(x.studentId)).FirstOrDefault().time : 0
- });
- return Ok(new { works, code = 200 });
- }
- else
- {
- var works = artResults.Select(x => new
- {
- stuId = x.studentId,
- x.studentName,
- x.classIds,
- x.artId,
- isAnswer = string.IsNullOrWhiteSpace(x.zyanswer.thirdAnswerId) ? 0 : 1,
- attachments = artAttachments.Count > 0 ? artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId)).ToList().FirstOrDefault(): null,
- //time = artAttachments.Count > 0 ? artAttachments.Where(c => c.taskId.Equals(taskId.GetString()) && c.studentId.Equals(x.studentId))?.LastOrDefault().updateTime : 0,
- });
- return Ok(new { works, code = 200 });
- }
- }
- catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
- {
- return Ok(new { code = 404 });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/find-summary-by-work()\n{e.Message}\n{e.StackTrace}\n", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- /// <param name="request"></param>
- /// <returns></returns>
- [ProducesDefaultResponseType]
- [Authorize(Roles = "IES")]
- [AuthToken(Roles = "teacher,admin")]
- [HttpPost("find-by-teacher")]
- public async Task<IActionResult> FindByTeacher(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
- if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
- var client = _azureCosmos.GetCosmosClient();
- var query = $"select c.id,c.img,c.name,c.startTime,c.type,c.endTime,c.presenter,c.topic,c.address,c.owner from c join A0 in c.teachers where A0.id = '{tId}'";
- List<object> arts = new();
- await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIteratorSql(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Art-{code}") }))
- {
- using var json = await JsonDocument.ParseAsync(item.Content);
- if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
- {
- arts.Add(obj.ToObject<object>());
- }
- }
- }
- return Ok(new { arts });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/find-by-teacher()\n{e.Message}\n{e.StackTrace}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- [ProducesDefaultResponseType]
- [Authorize(Roles = "IES")]
- [AuthToken(Roles = "teacher,admin")]
- [HttpPost("find-summary-by-teacher")]
- public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
- {
- try
- {
- if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
- if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
- if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
- var client = _azureCosmos.GetCosmosClient();
- List<object> arts = new();
- await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIteratorSql(queryText: $"select value(c) from c join A0 in c.teachers where A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Art-{code}") }))
- {
- using var json = await JsonDocument.ParseAsync(item.Content);
- if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
- {
- foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
- {
- arts.Add(obj.ToObject<object>());
- }
- }
- }
- return Ok(new { arts });
- }
- catch (Exception e)
- {
- await _dingDing.SendBotMsg($"OS,{_option.Location},art/find-summary-by-teacher()\n{e.Message}\n{e.StackTrace}\n{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
- return Ok(new { code = 500 });
- }
- }
- private class stuFiles
- {
- public string id { get; set; }
- public string school { get; set; }
- public string artId { get; set; }
- public string taskId { get; set; }
- public string studentId { get; set; }
- public string quotaId { get; set; }
- public string quotaName { get; set; }
- public string subjectId { get; set; }
- public string address { get; set; }
- public string time { get; set; }
- public string duration { get; set; }
- public string achievement { get; set; }
- public string name { get; set; }
- public string des { get; set; }
- //0 艺术特长 1 艺术体验
- public int artType { get; set; } = -1;
- // 0 校级 1 区级 2 市级 3 省级 4 国家级
- public int level { get; set; } = -1;
- public long uploadTime { get; set; }
- public string uploadName { get; set; }
- public List<Attachment> files { get; set; } = new List<Attachment>();
- }
- private class studentInfos
- {
- public string id { get; set; }
- public string paper { get; set; }
- public string subject { get; set; }
- // 评分状态,0,未评分, 1已评分
- public int sStatus { get; set; }
- //任务完成状态,-1 未参与,0,未完成, 1已完成
- public int taskStatus { get; set; }
- public long startTime { get; set; }
- public long endTime { get; set; }
- }
- }
- }
|