|
|
@@ -256,14 +256,14 @@ namespace Learun.Application.WebApi |
|
|
|
//string account = parameter.StuNo; |
|
|
|
|
|
|
|
var parameter = this.GetReq<SignModel>(); |
|
|
|
string keyValue = parameter.keyValue; |
|
|
|
string account = parameter.StuNo; |
|
|
|
|
|
|
|
SignUpHelper.Instance.Start(); |
|
|
|
//进队列 |
|
|
|
SignUpHelper.AddQueue(account, keyValue); |
|
|
|
//string keyValue = parameter.keyValue; |
|
|
|
//string account = parameter.StuNo; |
|
|
|
|
|
|
|
return Success("操作成功"); |
|
|
|
//SignUpHelper.Instance.Start(); |
|
|
|
////进队列 |
|
|
|
//SignUpHelper.AddQueue(account, keyValue); |
|
|
|
return SignInPre(parameter.StuNo, parameter.keyValue); |
|
|
|
//return Success("操作成功"); |
|
|
|
} |
|
|
|
public Response SignInByMobile(dynamic _) |
|
|
|
{ |
|
|
@@ -463,7 +463,123 @@ namespace Learun.Application.WebApi |
|
|
|
#endregion |
|
|
|
|
|
|
|
#region 私有类 |
|
|
|
|
|
|
|
private Response SignInPre(string account, string keyValue) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
//学员信息 |
|
|
|
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); |
|
|
|
if (stuInfoBasicEntity == null) |
|
|
|
{ |
|
|
|
//return Fail("当前学员不存在!"); |
|
|
|
return Fail("当前学员不存在!"); |
|
|
|
} |
|
|
|
//课程信息 |
|
|
|
var olpeEntity = openLessonPlanOfElectiveIbll.GetOpenLessonPlanOfElectiveEntity(keyValue); |
|
|
|
if (olpeEntity == null) |
|
|
|
{ |
|
|
|
//return Fail("当前课程不存在!"); |
|
|
|
return Fail("当前课程不存在!"); |
|
|
|
} |
|
|
|
//所选课程的报名人数是否已满 |
|
|
|
var aa = stuSelectLessonListOfElectiveIBLL.GetStuSelectLessonListOfElectiveListByOLPEId(olpeEntity.Id); |
|
|
|
var aaa = aa.Where(x => x.Status == 1 || x.Status == 2).Count(); |
|
|
|
if (aaa >= olpeEntity.StuNumMax) |
|
|
|
{ |
|
|
|
//return Fail("当前课程报名人数已满,请选择其他课程!"); |
|
|
|
return Fail("当前课程报名人数已满,请选择其他课程!"); |
|
|
|
} |
|
|
|
//每学期两门 |
|
|
|
var sslleList = stuSelectLessonListOfElectiveIBLL.GetStuSelectLessonListOfElectiveListByStuNo(account); |
|
|
|
var sslleListOfNow = sslleList.Where(x => x.AcademicYearNo == olpeEntity.AcademicYearNo && x.Semester == olpeEntity.Semester); |
|
|
|
var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); |
|
|
|
var sslleListOfNow2 = sslleListOfNow.Where(x => x.Status == 3); |
|
|
|
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt()) |
|
|
|
{ |
|
|
|
return Fail("每学期最多选择两门选修课!"); |
|
|
|
//return; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var m = sslleListOfNow1.FirstOrDefault(x => x.OLPEId == olpeEntity.Id); |
|
|
|
if (m != null) |
|
|
|
{ |
|
|
|
if (m.Status == 1) |
|
|
|
{ |
|
|
|
return Fail("当前课程报名审核中,请耐心等待!"); |
|
|
|
//return; |
|
|
|
} |
|
|
|
else if (m.Status == 2) |
|
|
|
{ |
|
|
|
return Success("当前课程已报名成功!"); |
|
|
|
//return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (sslleListOfNow2.Count() > 0) |
|
|
|
{ |
|
|
|
foreach (var item in sslleListOfNow2) |
|
|
|
{ |
|
|
|
stuSelectLessonListOfElectiveIBLL.DeleteEntity(item.Id); |
|
|
|
} |
|
|
|
} |
|
|
|
//相同时间不能报名 |
|
|
|
if (sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) |
|
|
|
{ |
|
|
|
return Success("本学期此时间段已有报名的选修课!"); |
|
|
|
} |
|
|
|
//相同课程不能报名 |
|
|
|
if (sslleListOfNow1.Where(x => x.LessonNo == olpeEntity.LessonNo).Any()) |
|
|
|
{ |
|
|
|
//return Fail("相同课程不能报名!"); |
|
|
|
return Success("本学期此课程已报名!"); |
|
|
|
} |
|
|
|
//新增报名数据 |
|
|
|
var model = new StuSelectLessonListOfElectiveEntity() |
|
|
|
{ |
|
|
|
OLPEId = olpeEntity.Id, |
|
|
|
NoticeBookNo = stuInfoBasicEntity.NoticeNo, |
|
|
|
StuNo = stuInfoBasicEntity.StuNo, |
|
|
|
DeptNo = stuInfoBasicEntity.DeptNo, |
|
|
|
MajorNo = stuInfoBasicEntity.MajorNo, |
|
|
|
ClassNo = stuInfoBasicEntity.ClassNo, |
|
|
|
MajorDetailNo = stuInfoBasicEntity.MajorDetailNo, |
|
|
|
MajorDetailName = stuInfoBasicEntity.MajorDetailName, |
|
|
|
StuName = stuInfoBasicEntity.StuName, |
|
|
|
GenderNo = stuInfoBasicEntity.GenderNo, |
|
|
|
Grade = stuInfoBasicEntity.Grade, |
|
|
|
AcademicYearNo = olpeEntity.AcademicYearNo, |
|
|
|
Semester = olpeEntity.Semester, |
|
|
|
LessonNo = olpeEntity.LessonNo, |
|
|
|
LessonName = olpeEntity.LessonName, |
|
|
|
LessonSortNo = olpeEntity.LessonSortNo, |
|
|
|
LessonSection = olpeEntity.LessonSection, |
|
|
|
LessonTime = olpeEntity.LessonTime, |
|
|
|
EmpNo = olpeEntity.EmpNo, |
|
|
|
EmpName = olpeEntity.EmpName, |
|
|
|
ClassRoomNo = olpeEntity.ClassRoomNo, |
|
|
|
ClassRoomName = olpeEntity.ClassRoomName, |
|
|
|
StudyScore = olpeEntity.StudyScore, |
|
|
|
StartWeek = olpeEntity.StartWeek, |
|
|
|
EndWeek = olpeEntity.EndWeek, |
|
|
|
StartDate = olpeEntity.StartDate, |
|
|
|
EndDate = olpeEntity.EndDate, |
|
|
|
CreateTime = DateTime.Now, |
|
|
|
Status = 1, |
|
|
|
OrdinaryScoreScale = 1, |
|
|
|
TermInScoreScale = 1, |
|
|
|
TermEndScoreScale = 1, |
|
|
|
OtherScoreScale = 1, |
|
|
|
F_SchoolId = olpeEntity.F_SchoolId |
|
|
|
}; |
|
|
|
stuSelectLessonListOfElectiveIBLL.SaveEntity("", model); |
|
|
|
return Success("报名成功"); |
|
|
|
} |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
return Fail("系统异常!请联系管理员"); |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 表单实体类 |
|
|
|
/// <summary> |
|
|
|