From 604492ebc5f8c62238280b080349b49ce9057552 Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Mon, 31 Oct 2022 14:26:09 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E5=AD=90=E5=9C=A8=E7=BA=BF--=E5=AD=A6?=
=?UTF-8?q?=E7=94=9F=E9=80=89=E8=AF=BE=20=20=E4=B8=93=E4=B8=9A=E9=80=89?=
=?UTF-8?q?=E4=BF=AE=E8=AF=BE=E6=A0=B9=E6=8D=AE=E5=AD=A6=E7=94=9F=E9=80=89?=
=?UTF-8?q?=E8=AF=BE=E6=AC=A1=E6=95=B0=E8=A1=A8=E5=88=A4=E6=96=AD=E9=80=89?=
=?UTF-8?q?=E8=AF=BE=E4=B8=8A=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../OpenLessonPlanOfElectiveController.cs | 24 ++++++++++++++++++-
.../XmlConfig/system.config | 2 +-
.../OpenLessonPlanOfElectiveStudentApi.cs | 24 +++++++++++++++++++
.../LessonInfo/LessonInfoBLL.cs | 19 +++++++++++++++
.../LessonInfo/LessonInfoEntity.cs | 2 ++
.../LessonInfo/LessonInfoIBLL.cs | 2 ++
.../LessonInfo/LessonInfoService.cs | 24 +++++++++++++++++++
.../OpenLessonPlanOfElectiveService.cs | 2 ++
8 files changed, 97 insertions(+), 2 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs
index ee3573eb5..f855d7fb1 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs
@@ -27,6 +27,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
private StuSelectLessonListOfElectivePreIBLL stuSelectLessonListOfElectivePreIBLL = new StuSelectLessonListOfElectivePreBLL();
private OpenLessonPlanOfElectiveChangeIBLL openLessonPlanOfElectiveChangeIBLL = new OpenLessonPlanOfElectiveChangeBLL();
private DataSourceIBLL dataSourceIBLL = new DataSourceBLL();
+ private OLPElectiveStuSelectCountIBLL oLPElectiveStuSelectCountIBLL = new OLPElectiveStuSelectCountBLL();
+ private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL();
#region 视图功能
@@ -752,7 +754,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
//相同时间不能报名
return Success("本学期此时间段已有报名的选修课!");
}
-
+ //专业选修课根据学生选课次数表判断选课上限
+ var lesson = lessonInfoIBLL.GetLessonInfoAndTypeByLessonNo(olpeEntity.LessonNo);
+ if (lesson.LessonTypeCode.Contains("Professional"))
+ {
+ var oLPElectiveStuSelectCount = oLPElectiveStuSelectCountIBLL.GetOLPElectiveStuSelectCountEntity(olpeEntity.AcademicYearNo, olpeEntity.Semester, loginUserInfo.departmentId);
+ if (sslleListOfNow1.Count() > oLPElectiveStuSelectCount.SelectMaxCount)
+ {
+ return Fail("本系部最多选择" + oLPElectiveStuSelectCount.SelectMaxCount + "门专业选修课!");
+ }
+ }
}
return Fail("正在提交,请等待!");
@@ -873,6 +884,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
}
}
}
+
+ //专业选修课根据学生选课次数表判断选课上限
+ var lesson = lessonInfoIBLL.GetLessonInfoAndTypeByLessonNo(olpeEntity.LessonNo);
+ if (lesson.LessonTypeCode.Contains("Professional"))
+ {
+ var oLPElectiveStuSelectCount = oLPElectiveStuSelectCountIBLL.GetOLPElectiveStuSelectCountEntity(olpeEntity.AcademicYearNo, olpeEntity.Semester, loginUserInfo.departmentId);
+ if (sslleListOfNow1.Count() > oLPElectiveStuSelectCount.SelectMaxCount)
+ {
+ return Fail("本系部最多选择" + oLPElectiveStuSelectCount.SelectMaxCount + "门专业选修课!");
+ }
+ }
if (sslleListOfNow2.Count() > 0)
{
foreach (var item in sslleListOfNow2)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
index 83bd00b85..15f634412 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config
@@ -143,7 +143,7 @@
-
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs
index ef5da5b16..4d6b68718 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/OpenLessonPlanOfElectiveStudentApi.cs
@@ -22,6 +22,8 @@ namespace Learun.Application.WebApi
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
LessonInfoIBLL lessonInfoIbll = new LessonInfoBLL();
EmpInfoIBLL empInfoIbll = new EmpInfoBLL();
+ private OLPElectiveStuSelectCountIBLL oLPElectiveStuSelectCountIBLL = new OLPElectiveStuSelectCountBLL();
+ private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL();
///
/// 注册接口
@@ -123,6 +125,17 @@ namespace Learun.Application.WebApi
//相同时间不能报名
return Success("本学期此时间段已有报名的选修课!");
}
+
+ //专业选修课根据学生选课次数表判断选课上限
+ var lesson = lessonInfoIBLL.GetLessonInfoAndTypeByLessonNo(olpeEntity.LessonNo);
+ if (lesson.LessonTypeCode.Contains("Professional"))
+ {
+ var oLPElectiveStuSelectCount = oLPElectiveStuSelectCountIBLL.GetOLPElectiveStuSelectCountEntity(olpeEntity.AcademicYearNo, olpeEntity.Semester, stuInfoBasicEntity.DeptNo);
+ if (sslleListOfNow1.Count() > oLPElectiveStuSelectCount.SelectMaxCount)
+ {
+ return Fail("本系部最多选择" + oLPElectiveStuSelectCount.SelectMaxCount + "门专业选修课!");
+ }
+ }
}
return Fail("正在提交,请等待!");
@@ -381,6 +394,17 @@ namespace Learun.Application.WebApi
}
}
}
+
+ //专业选修课根据学生选课次数表判断选课上限
+ var lesson = lessonInfoIBLL.GetLessonInfoAndTypeByLessonNo(olpeEntity.LessonNo);
+ if (lesson.LessonTypeCode.Contains("Professional"))
+ {
+ var oLPElectiveStuSelectCount = oLPElectiveStuSelectCountIBLL.GetOLPElectiveStuSelectCountEntity(olpeEntity.AcademicYearNo, olpeEntity.Semester, stuInfoBasicEntity.DeptNo);
+ if (sslleListOfNow1.Count() > oLPElectiveStuSelectCount.SelectMaxCount)
+ {
+ return Fail("本系部最多选择" + oLPElectiveStuSelectCount.SelectMaxCount + "门专业选修课!");
+ }
+ }
if (sslleListOfNow2.Count() > 0)
{
foreach (var item in sslleListOfNow2)
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoBLL.cs
index 1bdfcc200..fd7ec8c62 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoBLL.cs
@@ -108,6 +108,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+ public LessonInfoEntity GetLessonInfoAndTypeByLessonNo(string lessonNo)
+ {
+ try
+ {
+ return lessonInfoService.GetLessonInfoAndTypeByLessonNo(lessonNo);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
public bool GetAny()
{
try
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoEntity.cs
index 2e8fa4042..e8c1bd572 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoEntity.cs
@@ -191,6 +191,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#region 扩展字段
[NotMapped]
public string LessonTypeName { get; set; }
+ [NotMapped]
+ public string LessonTypeCode { get; set; }
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoIBLL.cs
index 9e56b4fd0..209c34244 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoIBLL.cs
@@ -35,6 +35,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
LessonInfoEntity GetLessonInfoEntityByLessonNo(string lessonNo);
+
+ LessonInfoEntity GetLessonInfoAndTypeByLessonNo(string lessonNo);
bool GetAny();
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoService.cs
index 716339fb2..8393d2912 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfo/LessonInfoService.cs
@@ -168,6 +168,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ ///
+ /// 获取LessonInfo表实体数据和课程类型
+ /// 主键
+ ///
+ ///
+ public LessonInfoEntity GetLessonInfoAndTypeByLessonNo(string lessonNo)
+ {
+ try
+ {
+ string sql = $"select a.*,b.LessonTypeCode from LessonInfo a join CdLessonType b on a.LessonTypeId=b.LTId where a.LessonNo='{lessonNo}'";
+ return this.BaseRepository("CollegeMIS").FindList(sql).FirstOrDefault();
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
#endregion
#region 提交数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs
index ab6df0a32..a339aeabb 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs
@@ -206,6 +206,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
strSql.Append(" ) ");
strSql.Append(" and a.MajorId is not null and a.Grade is not null ");
strSql.Append(" AND b.AcademicYearNo='" + EADateArrangeEntityAboutElective?.AcademicYearNo + "' and b.Semester='" + EADateArrangeEntityAboutElective?.Semester + "' ");
+ //学生选课显示‘是否可选’为‘是’的课程信息
+ strSql.Append(" and b.IsAllowSelect=1 ");
if (!queryParam["StuMajorNo"].IsEmpty())
{
dp.Add("StuMajorNo", queryParam["StuMajorNo"].ToString(), DbType.String);