|
@@ -130,7 +130,7 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- string SummarySql = " c.id,c.code,c.name,c.no,c.periodId,c.scope,c.school,c.creatorId,c.type,c.year,c.tcount,c.scount,c.leader ,c.froms ,c.joinLock ,c.expire ,c.grades ";
|
|
|
+ string SummarySql = " c.id,c.code,c.name,c.no,c.periodId,c.scope,c.school,c.creatorId,c.type,c.year,c.tcount,c.scount,c.leader ,c.froms ,c.joinLock ,c.review,c.limit ,c.expire,c.qrcodeExpire ,c.grades ";
|
|
|
if (groupTypes.IsEmpty() || groupTypes.Contains("teach")) {
|
|
|
//教学班
|
|
|
string teachsql="";
|
|
@@ -182,7 +182,7 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- ///-1状态异常,0加入成功, 1加入学生或醍摩豆ID为空,2重复加入 ,3不允许跨校加入名单, 4表示个人名单未开放加入
|
|
|
+ ///-1状态异常,0加入成功, 1加入学生或醍摩豆ID为空,2重复加入 ,3不允许跨校加入名单, 4表示个人名单未开放加入,状态=5 ,人数已满,且没有开启审核模式。状态=6 ,人数已满,需要审核通过再加入。状态7 二维码设置已经过期
|
|
|
/// </summary>
|
|
|
/// <param name="client"></param>
|
|
|
/// <param name="_stuListNo"></param>
|
|
@@ -190,7 +190,7 @@ namespace TEAMModelOS.SDK
|
|
|
/// <param name="type"></param>
|
|
|
/// <param name="school"></param>
|
|
|
/// <returns></returns>
|
|
|
- public static async Task<(int status, GroupList stuList,Member member)> CodeJoinList(CosmosClient client, string _stuListNo, string userid, int type, string school,int year)
|
|
|
+ public static async Task<(int status, GroupList stuList,Member member)> CodeJoinList(CosmosClient client,AzureRedisFactory _azureRedis, string _stuListNo, string userid, int type, string school,int year,string name ,string picture,string lang )
|
|
|
{
|
|
|
var queryNo = $"SELECT value(c) FROM c where c.no ='{_stuListNo}'";
|
|
|
(int status, GroupList stuList,Member member) data = (-1, null,null);
|
|
@@ -211,7 +211,33 @@ namespace TEAMModelOS.SDK
|
|
|
//状态=4 表示未开放加入。
|
|
|
return (4, item, null) ;
|
|
|
}
|
|
|
+ if (item.members!=null &&item.limit>0 && item.members.Count>item.limit) {
|
|
|
+ if (item.review ==1)
|
|
|
+ {
|
|
|
+ //状态=6 ,人数已满,需要审核通过再加入。
|
|
|
+
|
|
|
+ long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
+ if (now>item.qrcodeExpire)
|
|
|
+ {
|
|
|
+ //二维码设置已经过期,只有需要审核的时候才检查二维码过期问题,目的是为了未正式加入人员的缓存
|
|
|
+ return (7, item, null);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ string key = $"GroupList:Waitinglist:{item.scope}:{item.id}";
|
|
|
+ string filed = !string.IsNullOrWhiteSpace(school)?$"{school}:{userid}":userid;
|
|
|
+ await _azureRedis.GetRedisClient(8).HashSetAsync(key, filed, new { _stuListNo, userid , type , school ,year,id=item.id,name ,picture,lang }.ToJsonString());
|
|
|
+ await _azureRedis.GetRedisClient(8).KeyExpireAsync(key, expiry: DateTimeOffset.FromUnixTimeMilliseconds(item.qrcodeExpire).UtcDateTime);
|
|
|
+ return (6, item, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //状态=5 ,人数已满,且没有开启审核模式。
|
|
|
+ return (5, item, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
data = JoinList(item, userid, type, school,year);
|
|
|
+ //TODO 需要考虑已经通过别的途径加入名单,但是缓存数据仍记录数据的问题。 还要考虑手动加入过的。或者在获取名未加入名单成员的临时缓存数据的时候过滤已经加入的。
|
|
|
break;
|
|
|
}
|
|
|
return data;
|
|
@@ -532,7 +558,7 @@ namespace TEAMModelOS.SDK
|
|
|
/// <param name="graduate">毕业类型0在校,1毕业 , -1查全部。</param>
|
|
|
/// <returns></returns>
|
|
|
public static async Task<List<GroupListDto>> GetGroupListByListids(CosmosClient client, DingDing _dingDing, List<string> classes, string school,
|
|
|
- string SummarySql = " c.id,c.code,c.name,c.no,c.periodId,c.scope,c.school,c.creatorId,c.type,c.year,c.tcount,c.scount,c.leader ,c.froms ,c.joinLock ,c.expire ,c.grades ", int graduate = -1)
|
|
|
+ string SummarySql = " c.id,c.code,c.name,c.no,c.periodId,c.scope,c.school,c.creatorId,c.type,c.year,c.tcount,c.scount,c.leader ,c.froms ,c.joinLock ,c.review,c.limit ,c.expire ,c.qrcodeExpire ,c.grades ", int graduate = -1)
|
|
|
{
|
|
|
classes.RemoveAll(x => x == null);
|
|
|
if (!classes.IsNotEmpty()) {
|