Procházet zdrojové kódy

【修改】选修课选课结果接口、选修课预选课接口返回结果形式的调整;移动端选修课选课结果提示、预选课结果提示的调整;

master
dyy před 3 roky
rodič
revize
14da702d1d
4 změnil soubory, kde provedl 43 přidání a 18 odebrání
  1. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudent/form/form.js
  2. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentPre/form/form.js
  3. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseNoAuthentication.cs
  4. +34
    -16
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs

+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudent/form/form.js Zobrazit soubor

@@ -35,7 +35,8 @@
dataresult, inforesult) => { dataresult, inforesult) => {
learun.layer.loading(false); learun.layer.loading(false);
clearInterval(timer); clearInterval(timer);
learun.layer.toast(inforesult);
//learun.layer.toast(inforesult);
learun.layer.toast(dataresult.msg);
learun.nav.closeCurrent(); learun.nav.closeCurrent();
var prepage = learun.nav.getpage('EducationalAdministration/OpenLessonPlanOfElectiveStudent'); var prepage = learun.nav.getpage('EducationalAdministration/OpenLessonPlanOfElectiveStudent');
prepage.grid.reload(); prepage.grid.reload();


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentPre/form/form.js Zobrazit soubor

@@ -26,7 +26,8 @@
learun.httppost(config.webapi + 'learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/SignInPre', _postData, (data,info) => { learun.httppost(config.webapi + 'learun/EducationalAdministration/OpenLessonPlanOfElectiveStudent/SignInPre', _postData, (data,info) => {
learun.layer.loading(false); learun.layer.loading(false);
if (data) {// 表单数据保存成功 if (data) {// 表单数据保存成功
learun.layer.toast(info);
//learun.layer.toast(info);
learun.layer.toast(data.msg);
learun.nav.closeCurrent(); learun.nav.closeCurrent();
var prepage = learun.nav.getpage('EducationalAdministration/OpenLessonPlanOfElectiveStudentPre'); var prepage = learun.nav.getpage('EducationalAdministration/OpenLessonPlanOfElectiveStudentPre');
prepage.grid.reload(); prepage.grid.reload();


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseNoAuthentication.cs Zobrazit soubor

@@ -139,6 +139,11 @@ namespace Learun.Application.WebApi
ResParameter res = new ResParameter { code = ResponseCode.fail, info = info, data = new object { } }; ResParameter res = new ResParameter { code = ResponseCode.fail, info = info, data = new object { } };
return Response.AsText(res.ToJson()).WithContentType("application/json"); return Response.AsText(res.ToJson()).WithContentType("application/json");
} }
public Response Fail<T>(T data) where T : class
{
ResParameter res = new ResParameter { code = ResponseCode.fail, info = "响应失败", data = data };
return Response.AsText(res.ToJson()).WithContentType("application/json");
}
public Response FailNoLogin(string info) public Response FailNoLogin(string info)
{ {
ResParameter res = new ResParameter { code = ResponseCode.nologin, info = info, data = new object { } }; ResParameter res = new ResParameter { code = ResponseCode.nologin, info = info, data = new object { } };


+ 34
- 16
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs Zobrazit soubor

@@ -42,6 +42,8 @@ namespace Learun.Application.WebApi


private Response GetApplyResult(dynamic _) private Response GetApplyResult(dynamic _)
{ {
var msg = "正在提交,请等待!";//返回结果信息
var resultData = new { msg = msg };
dynamic parameter = this.GetReqData<dynamic>(); dynamic parameter = this.GetReqData<dynamic>();
string keyValue = parameter.keyValue; string keyValue = parameter.keyValue;
string account = parameter.StuNo; string account = parameter.StuNo;
@@ -49,13 +51,15 @@ namespace Learun.Application.WebApi
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account);
if (stuInfoBasicEntity == null) if (stuInfoBasicEntity == null)
{ {
return Success("当前学员不存在!");
msg = "当前学员不存在!";
return Success(resultData);
} }
//课程信息 //课程信息
var olpeEntity = openLessonPlanOfElectiveIbll.GetOpenLessonPlanOfElectiveEntity(keyValue); var olpeEntity = openLessonPlanOfElectiveIbll.GetOpenLessonPlanOfElectiveEntity(keyValue);
if (olpeEntity == null) if (olpeEntity == null)
{ {
return Success("当前课程不存在!");
msg = "当前课程不存在!";
return Success(resultData);
} }


//当前学员本学期是否有报名课程:每学期一门 //当前学员本学期是否有报名课程:每学期一门
@@ -93,11 +97,13 @@ namespace Learun.Application.WebApi
{ {
if (sslleEntity.Status == 1) if (sslleEntity.Status == 1)
{ {
return Success("当前课程报名审核中,请耐心等待!");
msg = "当前课程报名审核中,请耐心等待!";
return Success(resultData);
} }
else if (sslleEntity.Status == 2) else if (sslleEntity.Status == 2)
{ {
return Success("当前课程已报名成功!");
msg = "当前课程已报名成功!";
return Success(resultData);
} }
} }
else else
@@ -107,7 +113,8 @@ namespace Learun.Application.WebApi
var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); var aaa = aa.Count(x => x.Status == 1 || x.Status == 2);
if (aaa >= olpeEntity.StuNumMax) if (aaa >= olpeEntity.StuNumMax)
{ {
return Success("当前课程报名人数已满,请选择其他课程!");
msg = "当前课程报名人数已满,请选择其他课程!";
return Success(resultData);
} }
//每学期最多两门 //每学期最多两门
var sslleList = stuSelectLessonListOfElectiveIBLL.GetStuSelectLessonListOfElectiveListByStuNo(account); var sslleList = stuSelectLessonListOfElectiveIBLL.GetStuSelectLessonListOfElectiveListByStuNo(account);
@@ -115,17 +122,19 @@ namespace Learun.Application.WebApi
var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2);
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt()) if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{ {
return Success("每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!");
msg = "每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!";
return Success(resultData);
} }
//相同时间不能报名 //相同时间不能报名
if (sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) if (sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any())
{ {
//相同时间不能报名 //相同时间不能报名
return Success("本学期此时间段已有报名的选修课!");
msg = "本学期此时间段已有报名的选修课!";
return Success(resultData);
} }
} }


return Fail("正在提交,请等待!");
return Fail(resultData);
} }


#region 获取数据 #region 获取数据
@@ -312,6 +321,8 @@ namespace Learun.Application.WebApi
/// <returns></returns> /// <returns></returns>
public Response SignInPre(dynamic _) public Response SignInPre(dynamic _)
{ {
var msg = "报名成功";//返回结果信息
var resultData = new { msg = msg };
dynamic parameter = this.GetReqData<dynamic>(); dynamic parameter = this.GetReqData<dynamic>();
string keyValue = parameter.keyValue; string keyValue = parameter.keyValue;
string account = parameter.StuNo; string account = parameter.StuNo;
@@ -319,20 +330,23 @@ namespace Learun.Application.WebApi
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account);
if (stuInfoBasicEntity == null) if (stuInfoBasicEntity == null)
{ {
return Fail("当前学员不存在!");
msg = "当前学员不存在!";
return Fail(resultData);
} }
//课程信息 //课程信息
var olpeEntity = openLessonPlanOfElectiveIbll.GetOpenLessonPlanOfElectiveEntity(keyValue); var olpeEntity = openLessonPlanOfElectiveIbll.GetOpenLessonPlanOfElectiveEntity(keyValue);
if (olpeEntity == null) if (olpeEntity == null)
{ {
return Fail("当前课程不存在!");
msg = "当前课程不存在!";
return Fail(resultData);
} }
//所选课程的报名人数是否已满 //所选课程的报名人数是否已满
var aa = stuSelectLessonListOfElectivePreIBLL.GetStuSelectLessonListOfElectivePreListByOLPEId(olpeEntity.Id); var aa = stuSelectLessonListOfElectivePreIBLL.GetStuSelectLessonListOfElectivePreListByOLPEId(olpeEntity.Id);
var aaa = aa.Where(x => x.Status == 2).Count(); var aaa = aa.Where(x => x.Status == 2).Count();
if (aaa >= olpeEntity.StuNumMax) if (aaa >= olpeEntity.StuNumMax)
{ {
return Fail("当前课程报名人数已满,请选择其他课程!");
msg = "当前课程报名人数已满,请选择其他课程!";
return Fail(resultData);
} }
//当前学员本学期是否有报名课程:每学期一门 //当前学员本学期是否有报名课程:每学期一门
//var sslleEntity = stuSelectLessonListOfElectivePreIBLL.GetStuSelectLessonListOfElectivePreEntityByStuNo(account, ""); //var sslleEntity = stuSelectLessonListOfElectivePreIBLL.GetStuSelectLessonListOfElectivePreEntityByStuNo(account, "");
@@ -364,7 +378,8 @@ namespace Learun.Application.WebApi
var sslleListOfNow2 = sslleListOfNow.Where(x => x.Status == 3); var sslleListOfNow2 = sslleListOfNow.Where(x => x.Status == 3);
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt()) if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{ {
return Fail("每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!");
msg = "每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!";
return Fail(resultData);
} }
else else
{ {
@@ -373,11 +388,13 @@ namespace Learun.Application.WebApi
{ {
if (m.Status == 1) if (m.Status == 1)
{ {
return Fail("当前课程报名审核中,请耐心等待!");
msg = "当前课程报名审核中,请耐心等待!";
return Fail(resultData);
} }
else if (m.Status == 2) else if (m.Status == 2)
{ {
return Fail("当前课程已报名成功!");
msg = "当前课程已报名成功!";
return Fail(resultData);
} }
} }
} }
@@ -392,7 +409,8 @@ namespace Learun.Application.WebApi
if (sslleListOfNow1.Select(x => x.LessonSection == olpeEntity.LessonSection).Any()) if (sslleListOfNow1.Select(x => x.LessonSection == olpeEntity.LessonSection).Any())
{ {
//相同时间不能报名 //相同时间不能报名
return Success("本学期此时间段已有报名的选修课!");
msg = "本学期此时间段已有报名的选修课!";
return Success(resultData);
} }
//新增报名数据 //新增报名数据
var model = new StuSelectLessonListOfElectivePreEntity() var model = new StuSelectLessonListOfElectivePreEntity()
@@ -434,7 +452,7 @@ namespace Learun.Application.WebApi
}; };
stuSelectLessonListOfElectivePreIBLL.SaveEntity("", model); stuSelectLessonListOfElectivePreIBLL.SaveEntity("", model);


return Success("报名成功");
return Success(resultData);
} }
#endregion #endregion




Načítá se…
Zrušit
Uložit