From 5e262af6bc2599d1fbbf7fd18e984913de5e7712 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 7 Mar 2022 10:28:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=95=99=E6=9D=90?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=98=8E=E7=BB=86=E6=9F=A5=E7=9C=8B=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=98=BE=E7=A4=BA=E6=98=8E=E7=BB=86=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextBookOutController.cs | 2 +- .../TextBookOut/TextBookOutBLL.cs | 19 ++++++++++++++++++- .../TextBookOut/TextBookOutIBLL.cs | 1 + .../TextBookOut/TextBookOutService.cs | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs index 5c1dfbf6d..def172da9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs @@ -102,7 +102,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetFormData(string keyValue) { var TextBookInOutData = textBookInOutIBLL.GetKCEntity(keyValue); - var TextBookOutData = textBookOutIBLL.GetTextBookOutEntity(TextBookInOutData.BookCode); + var TextBookOutData = textBookOutIBLL.GetListByCode(TextBookInOutData.BookCode); var jsonData = new { TextBookInOut = TextBookInOutData, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs index c94c8eeaa..8cd9ccc26 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs @@ -42,7 +42,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + public IEnumerable GetListByCode(string code) + { + try + { + return textBookOutService.GetListByCode(code); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取TextBookOut表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.cs index 7caddad02..dab359913 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetListByCode(string code); /// /// 获取TextBookOut表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs index f6a484c1c..bf44e3788 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs @@ -105,6 +105,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetListByCode(string code) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == code); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取TextBookOut表实体数据 /// From 5f0af5f038c6aee204099cbc13891fd5d3e768a2 Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 7 Mar 2022 14:02:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E5=BC=82=E5=8A=A8=20=20?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=B5=81=E7=A8=8B=E8=B0=83=E6=95=B4=E8=A7=86?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuInfoBasicChange/FormView.cshtml | 21 +++++++----- .../Views/StuInfoBasicChange/FormView.js | 33 +++++++++++++++---- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.cshtml index 49adb43d5..fec9d53d1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.cshtml @@ -16,7 +16,6 @@
姓名*
-
异动类型*
@@ -25,22 +24,20 @@
异动原因*
- -
学籍原安排
+
学籍异动前信息
系部*
-
+
专业*
-
+
班级*
-
+
- -
学籍新安排
+
学籍异动后信息
- +
转出学校
+
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.js index 4b152fe0f..f32ec1e2a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasicChange/FormView.js @@ -31,22 +31,41 @@ var bootstrap = function ($, learun) { $("#NewMajorNo").siblings('div').html($("#NewMajorNo").siblings('div').attr('data-title') + '*'); $("#NewClassNo").siblings('div').html($("#NewClassNo").siblings('div').attr('data-title') + '*'); $(".NewContainer").show(); - if (item.id === "01" || item.id === "02") { //降级、转班 - //$(".NewContainer").find('.contentDiv.zhuanban').removeAttr('readonly'); + if (item.id === "01") { //留级 + $(".NewSchool").hide(); + $(".NewContainer").find('.contentDiv.zhuanban').removeAttr('readonly'); $("#NewDeptNo").lrselectSet($("#DeptNo").lrselectGet()); $("#NewMajorNo").lrselectSet($("#MajorNo").lrselectGet()); + $('#OutSchool').val(''); + } else if (item.id === "02") {//转校 + $(".NewSchool").show(); + $(".NewContainer").find('.contentDiv').removeAttr("isvalid"); + $(".NewContainer").find('.contentDiv').removeAttr("checkexpession"); + $(".NewContainer").find('.contentDiv').removeAttr('readonly'); + $(".NewSchool").find('.OutSchool').attr("isvalid", 'yes'); + $(".NewSchool").find('.OutSchool').attr("checkexpession"); + $(".NewSchool").find('.OutSchool').attr('readonly'); + } else if (item.id === "03") { //复学 + $(".NewSchool").hide(); + $(".NewContainer").find('.contentDiv').removeAttr('readonly'); + $(".NewSchool").find('.OutSchool').attr("isvalid", "Null"); + $('#OutSchool').val(''); + } else if (item.id === "04") { //转入 + $(".NewSchool").hide(); + $(".NewContainer").find('.contentDiv').removeAttr('readonly'); + $(".NewSchool").find('.OutSchool').attr("isvalid", "Null"); + $('#OutSchool').val(''); } - else if (item.id === "03") { //转专业 - //$(".NewContainer").find('.contentDiv').removeAttr('readonly'); - } - else if (item.id === "04" || item.id === "05") { //退学、休学 + else { //退学、休学、 $(".NewContainer").find('.contentDiv').removeAttr("isvalid"); $(".NewContainer").find('.contentDiv').removeAttr("checkexpession"); - //$(".NewContainer").find('.contentDiv').removeAttr('readonly'); + $(".NewContainer").find('.contentDiv').removeAttr('readonly'); $("#NewDeptNo").siblings('div').html($("#NewDeptNo").siblings('div').attr('data-title')); $("#NewMajorNo").siblings('div').html($("#NewMajorNo").siblings('div').attr('data-title')); $("#NewClassNo").siblings('div').html($("#NewClassNo").siblings('div').attr('data-title')); $(".NewContainer").hide(); + $(".NewSchool").hide(); + $('#OutSchool').val(''); } } From 53fdb5effe4df8b67565dd9229010094dfd3fda6 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 7 Mar 2022 14:05:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AE=BF=E8=88=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=99=90=E5=88=B6=E4=B8=80=E4=B8=AA=E4=BA=BA=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=88=86=E9=85=8D=E5=88=B0=E5=A4=9A=E4=B8=AA=E5=BA=8A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccommodationController.cs | 7 +++++- .../Views/Accommodation/FormRoom.js | 24 ++++++++++++------- .../Accommodation/AccommodationBLL.cs | 4 ++-- .../Accommodation/AccommodationIBLL.cs | 2 +- .../Accommodation/AccommodationService.cs | 15 +++++++++++- 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs index 5dd7d85e7..24e3ad8cf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs @@ -463,7 +463,12 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers public ActionResult SaveRoom(string RoomId, List list) { //List list = strEntity.ToObject>(); - accommodationIBLL.SaveRoom(RoomId, list); + string res = accommodationIBLL.SaveRoom(RoomId, list); + if (!string.IsNullOrEmpty(res)) + { + return Fail(res); + } + return Success("保存成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js index edc8a2238..be042398a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/FormRoom.js @@ -18,7 +18,7 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - + }, initData: function () { if (!!keyValue) { @@ -51,16 +51,16 @@ var bootstrap = function ($, learun) { value: "stuno", text: "stuname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', - param: { code: "StuInfoBasic", strWhere: strWhere }, + param: { code: "StuInfoBasic", strWhere: strWhere }, // 是否允许搜索 allowSearch: true, select: function (item) { - // console.log(item); + // console.log(item); var stuid = ''; if (item) { stuid = item.stuno; - } + } var id = $(this).attr('id'); //console.log('id', id); //console.log('item',item); @@ -78,9 +78,9 @@ var bootstrap = function ($, learun) { //arr.push({ ID: data[i].ID, StudentID: data[i].StudentID }); } - - - + + + }); } }, @@ -93,8 +93,14 @@ var bootstrap = function ($, learun) { //var postData = { // strEntity: JSON.stringify($('body').lrGetFormData()) //}; - //console.log('arr',arr); - + //console.log('arr', arr); + for (var i = 0; i < arr.length - 1; i++) { + for (var j = i + 1; j < arr.length; j++) { + if (!!arr[i].StudentID && arr[i].StudentID === arr[j].StudentID) { + return learun.alert.warning('学生不可重复!'); + } + } + } var postData = { list: arr }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs index d63fd9665..dcba8bb27 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs @@ -681,11 +681,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - public void SaveRoom(string RoomId, List list) + public string SaveRoom(string RoomId, List list) { try { - accommodationService.SaveRoom(RoomId, list); + return accommodationService.SaveRoom(RoomId, list); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs index 0f72b5a99..09ccf1e2c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs @@ -83,7 +83,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity); void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity); void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type); - void SaveRoom(string RoomId, List list); + string SaveRoom(string RoomId, List list); /// /// 批量添加单元、楼层、房间、床位 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs index b2508a78b..b184d56f2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs @@ -1721,13 +1721,25 @@ where ID='{ParentID}' /// /// /// - public void SaveRoom(string RoomId, List list) + public string SaveRoom(string RoomId, List list) { var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { foreach (var entity in list) { + //判断该学生是否已分配 + if (!string.IsNullOrEmpty(entity.StudentID)) + { + var count = db.FindList().Count(x => x.StudentID == entity.StudentID && x.ID != entity.ID); + if (count > 0) + { + var stuname = db.FindEntity(x => x.StuNo == entity.StudentID)?.StuName; + return "学生" + stuname + "已分配床位,不可重复分配!"; + } + } + + //分配床位 string sql = $"update Acc_DormitoryBuild set StudentID='{entity.StudentID}' where ID='{entity.ID}'"; db.ExecuteBySql(sql); } @@ -1737,6 +1749,7 @@ where ID='{ParentID}' db.ExecuteBySql(checkInSql); db.Commit(); + return ""; } catch (Exception ex) {