|
@@ -5,6 +5,7 @@ using DocumentFormat.OpenXml.Drawing;
|
|
using DocumentFormat.OpenXml.Drawing.Charts;
|
|
using DocumentFormat.OpenXml.Drawing.Charts;
|
|
using DocumentFormat.OpenXml.Math;
|
|
using DocumentFormat.OpenXml.Math;
|
|
using DocumentFormat.OpenXml.Spreadsheet;
|
|
using DocumentFormat.OpenXml.Spreadsheet;
|
|
|
|
+using DocumentFormat.OpenXml.Wordprocessing;
|
|
using HTEXLib.COMM.Helpers;
|
|
using HTEXLib.COMM.Helpers;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
@@ -30,12 +31,12 @@ namespace TEAMModelOS.SDK
|
|
/// <param name="activity"></param>
|
|
/// <param name="activity"></param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
|
|
|
- public static async Task<(List<ExpertContestTaskDto> expertContestTasks, List<(ActivityEnroll enroll, int Invalid)> activityEnrollsInvalid, List<ExpertContestTaskDto> expertContestTasksDB)> AllocationTask(AzureCosmosFactory _azureCosmos, IEnumerable<ExpertPeriodSubjectDto> experts, Contest activity,HashSet<string> periodSubjectKeys,string distribute, int taskCount)
|
|
|
|
|
|
+ public static async Task<(List<ExpertContestTaskDto> expertContestTasks, List<ExpertContestTaskDto > activityEnrollsInvalid, List<ExpertContestTaskDto> expertContestTasksDB)> AllocationTask(AzureCosmosFactory _azureCosmos, IEnumerable<ExpertPeriodSubjectDto> experts, Contest activity,HashSet<string> periodSubjectKeys,string distribute, int taskCount)
|
|
{
|
|
{
|
|
//检查报名,学段和科目是否匹配
|
|
//检查报名,学段和科目是否匹配
|
|
string enrollSQL = "select value c from c where c.pk='ActivityEnroll'";
|
|
string enrollSQL = "select value c from c where c.pk='ActivityEnroll'";
|
|
var resultActivityEnroll= await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<ActivityEnroll>(enrollSQL, $"ActivityEnroll-{activity.id}");
|
|
var resultActivityEnroll= await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).GetList<ActivityEnroll>(enrollSQL, $"ActivityEnroll-{activity.id}");
|
|
- List<(ActivityEnroll enroll , int Invalid)> activityEnrollsInvalid = new List<(ActivityEnroll enroll, int Invalid)>();
|
|
|
|
|
|
+ List<ExpertContestTaskDto > activityEnrollsInvalid = new List<ExpertContestTaskDto>();
|
|
Dictionary<string, List<ActivityEnroll>> uploads = new Dictionary<string, List<ActivityEnroll>>();
|
|
Dictionary<string, List<ActivityEnroll>> uploads = new Dictionary<string, List<ActivityEnroll>>();
|
|
foreach (ActivityEnroll enroll in resultActivityEnroll.list)
|
|
foreach (ActivityEnroll enroll in resultActivityEnroll.list)
|
|
{
|
|
{
|
|
@@ -48,8 +49,36 @@ namespace TEAMModelOS.SDK
|
|
periodSubjectKey = $"{period.val}-";
|
|
periodSubjectKey = $"{period.val}-";
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
|
|
+ int count = 0;
|
|
|
|
+ if (enroll.upload!=null && enroll.upload.sokrates.IsNotEmpty())
|
|
|
|
+ {
|
|
|
|
+ count += enroll.upload.sokrates.Count;
|
|
|
|
+ }
|
|
|
|
+ if (enroll.upload != null && enroll.upload.files.IsNotEmpty())
|
|
|
|
+ {
|
|
|
|
+ count += enroll.upload.files.Count;
|
|
|
|
+ }
|
|
//学段学科不匹配
|
|
//学段学科不匹配
|
|
- activityEnrollsInvalid.Add((enroll, 1));
|
|
|
|
|
|
+ var invalidTask = new ExpertContestTaskDto
|
|
|
|
+ {
|
|
|
|
+ uploadId = enroll.upload?.uploadId,
|
|
|
|
+ name = $"{enroll?.schoolName}-{enroll?.tmdName}",
|
|
|
|
+ uploadTypes = new List<string> { enroll?.upload.type },
|
|
|
|
+ count = count,
|
|
|
|
+ cipher = enroll.contest?.cipher,
|
|
|
|
+ type = enroll.contest != null ? enroll.contest.type : 0,
|
|
|
|
+ leader = enroll.contest != null ? enroll.contest.type : 0,
|
|
|
|
+ tmdid = enroll.id,
|
|
|
|
+ status = -1,
|
|
|
|
+ score = -1,
|
|
|
|
+ //detailScore=new List<RuleConfig>()
|
|
|
|
+ members = new List<IdNameCode>(),
|
|
|
|
+ periodSubjectKey = periodSubjectKey,
|
|
|
|
+ period = period?.val,
|
|
|
|
+ subject =null,
|
|
|
|
+ available=2
|
|
|
|
+ };
|
|
|
|
+ activityEnrollsInvalid.Add(invalidTask);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -61,9 +90,34 @@ namespace TEAMModelOS.SDK
|
|
periodSubjectKey = $"-{subject.val}";
|
|
periodSubjectKey = $"-{subject.val}";
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
-
|
|
|
|
|
|
+ int count = 0;
|
|
|
|
+ if (enroll.upload != null && enroll.upload.sokrates.IsNotEmpty())
|
|
|
|
+ {
|
|
|
|
+ count += enroll.upload.sokrates.Count;
|
|
|
|
+ }
|
|
|
|
+ if (enroll.upload != null && enroll.upload.files.IsNotEmpty())
|
|
|
|
+ {
|
|
|
|
+ count += enroll.upload.files.Count;
|
|
|
|
+ }
|
|
//学段学科不匹配
|
|
//学段学科不匹配
|
|
- activityEnrollsInvalid.Add((enroll, 1));
|
|
|
|
|
|
+ var invalidTask = new ExpertContestTaskDto
|
|
|
|
+ {
|
|
|
|
+ uploadId = enroll.upload?.uploadId,
|
|
|
|
+ name = $"{enroll?.schoolName}-{enroll?.tmdName}",
|
|
|
|
+ uploadTypes = new List<string> { enroll?.upload.type },
|
|
|
|
+ count = count,
|
|
|
|
+ cipher = enroll.contest?.cipher,
|
|
|
|
+ type = enroll.contest != null ? enroll.contest.type : 0,
|
|
|
|
+ leader = enroll.contest != null ? enroll.contest.type : 0,
|
|
|
|
+ tmdid = enroll.id,
|
|
|
|
+ status = -1,
|
|
|
|
+ score = -1,
|
|
|
|
+ members = new List<IdNameCode>(),
|
|
|
|
+ periodSubjectKey = periodSubjectKey,
|
|
|
|
+ period = null,
|
|
|
|
+ subject = subject?.val,
|
|
|
|
+ available = 3
|
|
|
|
+ }; activityEnrollsInvalid.Add(invalidTask);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -76,9 +130,34 @@ namespace TEAMModelOS.SDK
|
|
periodSubjectKey = $"{period.val}-{subject.val}";
|
|
periodSubjectKey = $"{period.val}-{subject.val}";
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
-
|
|
|
|
|
|
+ int count = 0;
|
|
|
|
+ if (enroll.upload != null && enroll.upload.sokrates.IsNotEmpty())
|
|
|
|
+ {
|
|
|
|
+ count += enroll.upload.sokrates.Count;
|
|
|
|
+ }
|
|
|
|
+ if (enroll.upload != null && enroll.upload.files.IsNotEmpty())
|
|
|
|
+ {
|
|
|
|
+ count += enroll.upload.files.Count;
|
|
|
|
+ }
|
|
//学段学科不匹配
|
|
//学段学科不匹配
|
|
- activityEnrollsInvalid.Add((enroll, 1));
|
|
|
|
|
|
+ var invalidTask = new ExpertContestTaskDto
|
|
|
|
+ {
|
|
|
|
+ uploadId = enroll.upload?.uploadId,
|
|
|
|
+ name = $"{enroll?.schoolName}-{enroll?.tmdName}",
|
|
|
|
+ uploadTypes = new List<string> { enroll?.upload.type },
|
|
|
|
+ count = count,
|
|
|
|
+ cipher = enroll.contest?.cipher,
|
|
|
|
+ type = enroll.contest != null ? enroll.contest.type : 0,
|
|
|
|
+ leader = enroll.contest != null ? enroll.contest.type : 0,
|
|
|
|
+ tmdid = enroll.id,
|
|
|
|
+ status = -1,
|
|
|
|
+ score = -1,
|
|
|
|
+ members = new List<IdNameCode>(),
|
|
|
|
+ periodSubjectKey = periodSubjectKey,
|
|
|
|
+ period = period?.val,
|
|
|
|
+ subject = subject?.val,
|
|
|
|
+ available = 3
|
|
|
|
+ }; activityEnrollsInvalid.Add(invalidTask);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -105,12 +184,12 @@ namespace TEAMModelOS.SDK
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
//未上传作品
|
|
//未上传作品
|
|
- activityEnrollsInvalid.Add((enroll, 2));
|
|
|
|
|
|
+ //activityEnrollsInvalid.Add((enroll, 2));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
//学段学科不匹配
|
|
//学段学科不匹配
|
|
- activityEnrollsInvalid.Add((enroll, 1));
|
|
|
|
|
|
+ //activityEnrollsInvalid.Add((enroll, 1));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
List<ExpertContestTaskDto> expertContestTasks = new List<ExpertContestTaskDto>();
|
|
List<ExpertContestTaskDto> expertContestTasks = new List<ExpertContestTaskDto>();
|