Переглянути джерело

修复学生报名选修课无响应

修改api测试数据库连接
娄底高职分支
王晓寒 2 місяці тому
джерело
коміт
ac95ccb6db
3 змінених файлів з 133 додано та 11 видалено
  1. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/StudentIndex.js
  2. +124
    -8
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs
  3. +7
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/database.config

+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/StudentIndex.js Переглянути файл

@@ -121,7 +121,8 @@ var bootstrap = function ($, learun) {
}, 5000);

} else {
learun.alert.warning("系统异常,请稍后!");
//learun.alert.warning("系统异常,请稍后!");
learun.alert.warning(res.info);
return false;
}
},


+ 124
- 8
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs Переглянути файл

@@ -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>


+ 7
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/database.config Переглянути файл

@@ -25,7 +25,12 @@
<add name="paikeDbString" connectionString="Data Source=10.30.0.11;Database=paike;User ID=root;Password=12345678;" providerName="MySql.Data.MySqlClient" />-->

<!--西昌-->
<add name="BaseDb" connectionString="Server=123.57.209.16,53314;Initial Catalog=adms7ultimate2_娄底;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<!--<add name="BaseDb" connectionString="Server=123.57.209.16,53314;Initial Catalog=adms7ultimate2_娄底;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="CollegeMIS" connectionString="Server=123.57.209.16,53314;Initial Catalog=CollegeMIS_娄底;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16,53314;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=123.57.209.16,53314;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />-->
<!--娄底测试库-->
<add name="BaseDb" connectionString="Server=8.141.155.183,53314;Initial Catalog=adms7ultimate2_娄底;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="CollegeMIS" connectionString="Server=8.141.155.183,53314;Initial Catalog=CollegeMIS_娄底;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="hangfireString" connectionString="Server=8.141.155.183,53314;Initial Catalog=Hangfire;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" />
<add name="paikeDbString" connectionString="Data Source=8.141.155.183;Port=23306;Database=paikeloudi;User ID=root;Password=QJKJ@bjqj@123;" providerName="MySql.Data.MySqlClient" />
</connectionStrings>

Завантаження…
Відмінити
Зберегти