|
@@ -345,6 +345,8 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
public static (int status, GroupList stuList, Member member) JoinList(GroupList stuList, string userid, int type, string school, int year, int seatNo = 0)
|
|
|
{
|
|
|
+
|
|
|
+ Member member = null;
|
|
|
int status = -1;
|
|
|
if (!string.IsNullOrWhiteSpace(stuList.school) && !string.IsNullOrWhiteSpace(school))
|
|
|
{
|
|
@@ -355,8 +357,42 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (seatNo>0) {
|
|
|
-
|
|
|
+ if (seatNo>0) {
|
|
|
+ var mb= stuList.members.Find(x => x.irs.Equals($"{seatNo}"));
|
|
|
+ if (mb==null) {
|
|
|
+ if (type == 1)
|
|
|
+ {
|
|
|
+ member = stuList.members.Find(x => x.type == 1 && x.id.Equals(userid));
|
|
|
+ if (member != null)
|
|
|
+ {
|
|
|
+ //重复加入
|
|
|
+ status = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ //加入成功
|
|
|
+ status = 0;
|
|
|
+ member = new Member { id = userid, type = type, irs = $"{seatNo}", no = $"{seatNo}", year=year,manual=1 };
|
|
|
+ stuList.members.Add(member);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (type == 2)
|
|
|
+ {
|
|
|
+ member = stuList.members.Find(x => x.type == 2 && x.id.Equals(userid) && x.code.Equals(school));
|
|
|
+ if (member != null)
|
|
|
+ {
|
|
|
+ //重复加入
|
|
|
+ status = 2;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ status = 0;
|
|
|
+ member = new Member { id = userid, code = school, type = type, irs = $"{seatNo}", no = $"{seatNo}", year = year, manual=1 };
|
|
|
+ stuList.members.Add(member);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return (status, stuList, member);
|
|
|
+ }
|
|
|
}
|
|
|
string irs = string.Empty;
|
|
|
List<string> irsOrder = stuList.members.Select(x => x.irs)?.Where(y => !string.IsNullOrEmpty(y) && Regex.IsMatch(y, @"^\d*$")).OrderBy(x => int.Parse(x)).ToList();
|
|
@@ -384,7 +420,7 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- Member member = null;
|
|
|
+
|
|
|
if (string.IsNullOrEmpty($"{userid}"))
|
|
|
{
|
|
|
//加入学生或醍摩豆ID为空
|