瀏覽代碼

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

master
dyy 3 年之前
父節點
當前提交
14da702d1d
共有 4 個檔案被更改,包括 43 行新增18 行删除
  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 查看文件

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


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentPre/form/form.js 查看文件

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


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/BaseNoAuthentication.cs 查看文件

@@ -139,6 +139,11 @@ namespace Learun.Application.WebApi
ResParameter res = new ResParameter { code = ResponseCode.fail, info = info, data = new object { } };
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)
{
ResParameter res = new ResParameter { code = ResponseCode.nologin, info = info, data = new object { } };


+ 34
- 16
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs 查看文件

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

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

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

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

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

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



Loading…
取消
儲存