Browse Source

【修改】选修课报名课程的最大数设置到配置文件中;

大厂分支
dyy 4 years ago
parent
commit
0f1e3fc2d0
5 changed files with 19 additions and 12 deletions
  1. +6
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs
  2. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
  3. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs
  4. +5
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config
  5. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SignUpHelper.cs

+ 6
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs View File

@@ -143,7 +143,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
public ActionResult GetPageListOfStudent(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = openLessonPlanOfElectiveIBLL.GetPageListOfStudent(paginationobj, queryJson).OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonNo).ThenBy(x=>x.EmpNo);
var data = openLessonPlanOfElectiveIBLL.GetPageListOfStudent(paginationobj, queryJson).OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonNo).ThenBy(x => x.EmpNo);
var jsonData = new
{
rows = data,
@@ -506,9 +506,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
var sslleList = stuSelectLessonListOfElectiveIBLL.GetStuSelectLessonListOfElectiveListByStuNo(loginUserInfo.enCode);
var sslleListOfNow = sslleList.Where(x => x.AcademicYearNo == olpeEntity.AcademicYearNo && x.Semester == olpeEntity.Semester);
var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2);
if (sslleListOfNow1.Count() >= 2)
//if (sslleListOfNow1.Count() >= 2)
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{
return Success("每学期最多选择门选修课!");
return Success("每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!");
}
//相同时间不能报名
if (sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any())
@@ -618,9 +619,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
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() >= 2)
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{
return Fail("每学期最多选择门选修课!");
return Fail("每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!");
}
else
{


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config View File

@@ -141,6 +141,8 @@

<!-- 报名选修课排队需要调用的WebApi -->
<add key="WebApi" value="http://localhost:8081/" />
<!-- 报名选修课的最大课程数 -->
<add key="ElectiveLessonApplyMax" value="2" />
<!-- 河南对接登录 -->
<add key="appid" value="TZ6RW1DUNIN6C5M88I" />
<add key="secret" value="55848ef07e0f4e0c991bc8b4426100b2" />


+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs View File

@@ -113,9 +113,9 @@ namespace Learun.Application.WebApi
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);
if (sslleListOfNow1.Count() >= 2)
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{
return Success("每学期最多选择门选修课!");
return Success("每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!");
}
//相同时间不能报名
if (sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any())
@@ -362,9 +362,9 @@ namespace Learun.Application.WebApi
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() >= 2)
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{
return Fail("每学期最多选择门选修课!");
return Fail("每学期最多选择" + Config.GetValue("ElectiveLessonApplyMax").ToInt() + "门选修课!");
}
else
{


+ 5
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config View File

@@ -62,7 +62,7 @@
<!-- SignalR服务接口-->
<add key="IMUrl" value="http://localhost:8012/signalr" />
<add key="IMOpen" value="true" />
<add key="userKey" value="14B417B0-463D-4F2B-8075-0A20EEDB773A" />
<!-- ==================注意附件上传地址 修改到主网站部署目录下的Resource要不然飞星会报错================== -->
<add key="AnnexesFile" value="D:\leiprojects\西昌单校区\Learun.Application.Web\Resource" />
@@ -91,7 +91,7 @@
<add key="owin:AutomaticAppStartup" value="true"/>
<!-- ================== 默认头像 ================== -->
<add key="defaultheadimg" value="/Content/images/head/on-boy.jpg" />
<!--统一身份认证加密公钥-->
<!--统一身份认证加密公钥-->
<add key="SSOPublicSecret" value="bjquanjiang" />
<!-- 深信服ACIp -->
<add key="ACIp" value=""/>
@@ -101,4 +101,7 @@
<!--疫情防控组角色Id-->
<add key="EpidemicControlTeamRoleId" value="87f38e4e-b0a6-472c-b01a-2620b8f1ec46" />
<add key="QJUrl" value="www.qj.com"/>
<!-- 报名选修课的最大课程数 -->
<add key="ElectiveLessonApplyMax" value="2" />
</appSettings>

+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SignUpHelper.cs View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Learun.Util;
using Microsoft.AspNet.SignalR;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
@@ -141,7 +142,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
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() >= 2)
if (sslleListOfNow1.Count() >= Config.GetValue("ElectiveLessonApplyMax").ToInt())
{
//return Fail("每学期最多选择两门选修课!");
return;


Loading…
Cancel
Save