From 0ad4f50afb6c76e6c79b2597e881e4782255f2c6 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 11 Oct 2022 09:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=A0=E9=99=A4=20=20=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenLessonPlanOfElectiveController.cs | 13 +++++- .../OpenLessonPlanOfElective/MergeIndex.js | 19 ++++++++- .../LR_Desktop/Views/LoginStatistics/Index.js | 1 + .../OpenLessonPlanOfElectiveBLL.cs | 19 +++++++++ .../OpenLessonPlanOfElectiveIBLL.cs | 1 + .../OpenLessonPlanOfElectiveService.cs | 41 +++++++++++++++++++ .../LoginStatistics/LoginStatisticsService.cs | 6 +++ 7 files changed, 96 insertions(+), 4 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 45cfcbdb6..7720ad7d4 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 @@ -242,7 +242,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } - + /// /// 获取当前学年学期 /// @@ -275,6 +275,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers openLessonPlanOfElectiveIBLL.DeleteEntity(keyValue); return Success("删除成功!"); } + + [HttpPost] + [AjaxOnly] + public ActionResult DeleteElective(string keyValue) + { + openLessonPlanOfElectiveIBLL.DeleteElective(keyValue); + return Success("删除成功!"); + } + /// /// 保存实体数据(新增、修改) /// 主键 @@ -450,7 +459,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// /// [HttpPost] - public ActionResult SaveStuNumMax(string keyValue,int StuNumMax) + public ActionResult SaveStuNumMax(string keyValue, int StuNumMax) { openLessonPlanOfElectiveIBLL.SaveStuNumMax(keyValue, StuNumMax); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js index 6f752e8b7..fb754313c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js @@ -253,8 +253,23 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var rowdata = $('#gridtable').jfGridGet('rowdata'); - console.log(rowdata); - + try { + rowdata.forEach(function (item, index, row) { + if (!!item.StuNumMax || !!item.StuNumOfApply || !!item.StuNum) { + throw learun.alert.warning("人数上限、已报人数、通过人数大于0的不能删除!"); + } + if (!!item.ElectiveMajorList && item.ElectiveMajorList.length > 0) { + throw learun.alert.warning("已选专业的数据不允许删除!"); + } + }); + console.log(keyValue); + return; + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/DeleteElective', { keyValue: keyValue }, + function () { + refreshGirdData(); + }); + } catch (e) { + } } }); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/LoginStatistics/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/LoginStatistics/Index.js index 65ff79496..291fd2bda 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/LoginStatistics/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/LoginStatistics/Index.js @@ -160,6 +160,7 @@ var bootstrap = function ($, learun) { } else { param.Month = date.getMonth() + 1; } + //param.SqlParameter = " and ((classno is null or len(classno)=0) and (departmentid is not null or len(departmentid)>0)) "; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs index 6b8ab28b9..5ef322074 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs @@ -186,6 +186,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + public void DeleteElective(string keyValue) + { + try + { + openLessonPlanOfElectiveService.DeleteElective(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 保存实体数据(新增、修改) /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs index 4d0ffcf3e..aa92ec4c7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs @@ -63,6 +63,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// void DeleteEntity(string keyValue); + void DeleteElective(string keyValue); /// /// 保存实体数据(新增、修改) /// 主键 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 9d2708485..896c34ea3 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 @@ -401,6 +401,47 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 删除选修课课程 + /// + /// + public void DeleteElective(string keyValue) + { + try + { + /* + * ElectiveMajor +[dbo].[OpenLessonPlanOfElective] +[dbo].[OpenLessonPlanOfElectiveChange] +[dbo].[OpenLessonPlanOfElectiveDel] +[dbo].[ArrangeLessonTermOfElective] 课号 老师 上课时间 节次 上课教室 学年学期 + */ + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + var list = this.BaseRepository("CollegeMIS").FindList($"select * from OpenLessonPlanOfElective where Id in ('{keyValue}')"); + foreach (var entity in list) + { + + } + + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 保存实体数据(新增、修改) /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/LoginStatistics/LoginStatisticsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/LoginStatistics/LoginStatisticsService.cs index 482cacace..74e000744 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/LoginStatistics/LoginStatisticsService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/LoginStatistics/LoginStatisticsService.cs @@ -47,6 +47,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { strSql.Append($" AND departmentid='{queryParam["Departmentid"].ToString()}'"); } + + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, paginationobj); } catch (Exception ex)