From 141d9c0afc8c50b1ffb68db50100425f916b7a59 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 29 Dec 2021 14:42:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AD=A6=E7=B1=8D=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E5=AD=A6=E7=B1=8D=E7=AE=A1=E7=90=86=E7=9C=8B=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=20=E8=BF=8E=E6=96=B0=E5=A1=AB=E6=8A=A5=E6=A0=87?= =?UTF-8?q?=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuVolunteerController.cs | 23 +++++++ .../Views/StuVolunteer/Form.cshtml | 2 +- .../Views/StuVolunteer/IndexLabel.cshtml | 2 + .../Views/StuVolunteer/IndexLabel.js | 40 +++++++++-- .../LR_Content/script/lr-validator-helper.js | 3 +- .../StuVolunteer/StuVolunteerBLL.cs | 46 +++++++++++++ .../StuVolunteer/StuVolunteerIBLL.cs | 12 ++++ .../StuVolunteer/StuVolunteerService.cs | 67 ++++++++++++++++++- 8 files changed, 185 insertions(+), 10 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs index 82651a746..f573ba020 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs @@ -285,6 +285,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("取消成功!"); } + /// + /// 标注数据 + /// + /// + /// + public ActionResult JoinForm(string keyValue) + { + stuVolunteerIBLL.JoinEntity(keyValue); + return Success("标注成功!"); + } + + /// + /// 取消数据 + /// + /// + /// + public ActionResult CanJoinForm(string keyValue) + { + stuVolunteerIBLL.CanJoin(keyValue); + return Success("取消成功!"); + } + + /// /// 填报志愿 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml index f87074ef2..e152d88d3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml @@ -21,7 +21,7 @@
学生姓名*
- +
性别*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.cshtml index 7d0551e4b..e93bbd4d0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.cshtml @@ -37,6 +37,8 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.js index a26708df0..7495773b3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexLabel.js @@ -47,6 +47,32 @@ var bootstrap = function ($, learun) { }); } }); + // 填报我校 + $('#lr_join').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认标注选中该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/JoinForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 取消填报本校 + $('#lr_canjoin').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否取消标注选中该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/CanJoinForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); // 填报志愿 $('#lr_school').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); @@ -79,6 +105,13 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetPageList', headData: [ + { + label: "录取意向(本校)", name: "IsCYSchool", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : + ""; + } + }, { label: "是否有意(本校)", name: "IsIntention", width: 100, align: "IsIntention", formatter: function (cellvalue) { @@ -110,13 +143,6 @@ var bootstrap = function ($, learun) { }); } }, - { - label: "录取意向", name: "IsCYSchool", width: 200, align: "left", - formatter: function (cellvalue) { - return cellvalue == true ? "" : - ""; - } - }, { label: "身份证号", name: "CardNo", width: 150, align: "left" }, { label: "中考总分", name: "StuScore", width: 100, align: "left" }, { label: "第一志愿", name: "FirstVolunteer", width: 120, align: "left" }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js index cf0f792a8..eef668139 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/lr-validator-helper.js @@ -136,7 +136,8 @@ return learun.validator.validRegOrNull(obj, /^[-\+]?\d+(\.\d+)?$/, '必须为小数或空'); }, isIDCard: function (obj) {//判断是否为身份证 idcard - return learun.validator.validReg(obj, /^\d{15}(\d{2}[A-Za-z0-9;])?$/, '必须为身份证格式'); + //return learun.validator.validReg(obj, /^\d{15}(\d{2}[A-Za-z0-9;])?$/, '必须为身份证格式'); + return learun.validator.validReg(obj, /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/, '必须为身份证格式'); }, isIDCardOrNull: function (obj) {//判断是否为身份证 idcard或者null,空 return learun.validator.validRegOrNull(obj, /^\d{15}(\d{2}[A-Za-z0-9;])?$/, '必须为身份证格式或空'); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs index a3bfc2d9d..4aa10bbc2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs @@ -402,6 +402,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 标注数据 + /// + /// 主键 + public void JoinEntity(string keyValue) + { + try + { + stuVolunteerService.JoinEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 取消标注数据 + /// + /// 主键 + public void CanJoin(string keyValue) + { + try + { + stuVolunteerService.CanJoin(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs index 66913ef6c..da8bd922d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs @@ -115,6 +115,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// StuVolunteerEntity GetEntityByCardNo(string keyValue); + + /// + /// 标注数据 + /// + /// 主键 + void JoinEntity(string keyValue); + + /// + /// 取消标注数据 + /// + /// 主键 + void CanJoin(string keyValue); #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs index ecd900a2c..33438fee6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs @@ -326,7 +326,7 @@ Stuid,StuNo,StuCode,ClassNo,StuName,GenderNo,DeptNo,MajorNo,IdentityCardNo,ExamS select newid(),StuNo,'G'+CardNo,ClassNo,StuName,Sex,DeptNo,MajorNo,CardNo,StuScore from StuVolunteer t where t.ClassStatus=1 and t.StuNo not in (select b.StuNo from StuInfoBasic b where b.StuNo=t.StuNo) "; - db.ExecuteBySql(updSql); + db.ExecuteBySql(addSql); db.Commit(); } @@ -603,6 +603,71 @@ and t.StuNo not in (select b.StuNo from StuInfoBasic b where b.StuNo=t.StuNo) " } } } + + + /// + /// 标注数据 + /// + /// 主键 + public void JoinEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var entity = db.FindEntity(x => x.ID == item); + entity.IsOurSchool = true; + db.Update(entity); + } + + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 取消标注数据 + /// + /// 主键 + public void CanJoin(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var entity = db.FindEntity(x => x.ID == item); + entity.IsOurSchool = false; + db.Update(entity); + } + + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion } }