From 932b5b71dc92aa6100b8705b9a423ff306126157 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 24 Dec 2021 16:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=8E=E6=96=B0=E7=B3=BB=E7=BB=9F--=E5=88=86?= =?UTF-8?q?=E7=8F=AD=E3=80=81=E7=94=9F=E6=88=90=E5=AD=A6=E7=B1=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuVolunteerController.cs | 76 +++++++- .../Views/StuVolunteer/ClassForm.cshtml | 11 ++ .../Views/StuVolunteer/ClassForm.js | 52 +++++ .../Views/StuVolunteer/FormGenerate.cshtml | 79 ++++++++ .../Views/StuVolunteer/FormGenerate.js | 59 ++++++ .../Views/StuVolunteer/IndexDivide.cshtml | 30 +-- .../Views/StuVolunteer/IndexDivide.js | 140 +++++++++----- .../Views/StuVolunteer/IndexGenerate.cshtml | 69 +++++++ .../Views/StuVolunteer/IndexGenerate.js | 182 ++++++++++++++++++ .../Views/StuVolunteer/IndexStatus.cshtml | 48 ----- .../Views/StuVolunteer/IndexStatus.js | 116 ----------- .../Learun.Application.Web.csproj | 10 +- .../StuVolunteer/StuVolunteerBLL.cs | 64 ++++++ .../StuVolunteer/StuVolunteerEntity.cs | 16 +- .../StuVolunteer/StuVolunteerIBLL.cs | 9 + .../StuVolunteer/StuVolunteerService.cs | 175 ++++++++++++++++- 16 files changed, 888 insertions(+), 248 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.js delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.cshtml delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.js 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 7d6157b71..82651a746 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 @@ -85,35 +85,52 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } /// - /// 生成学籍 + /// 录取 /// /// [HttpGet] - public ActionResult IndexStatus() + public ActionResult IndexEnroll() { return View(); } - /// - /// 录取 + /// 生成二维码 /// /// [HttpGet] - public ActionResult IndexEnroll() + public ActionResult QRCode() { return View(); } - /// - /// 生成二维码 + /// 分班--选择班级 /// /// [HttpGet] - public ActionResult QRCode() + public ActionResult ClassForm() { return View(); } + /// + /// 生成学籍 + /// + /// + [HttpGet] + public ActionResult IndexGenerate() + { + return View(); + } + /// + /// 生成学籍--编辑 + /// + /// + [HttpGet] + public ActionResult FormGenerate() + { + return View(); + } + #endregion #region 获取数据 @@ -200,6 +217,47 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuVolunteerIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + + /// + /// 分班 + /// + /// 主键 + /// 班级 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveClassForm(string keyValue, string ClassNo) + { + stuVolunteerIBLL.SaveClassForm(keyValue, ClassNo); + return Success("保存成功!"); + } + /// + /// 分班-审核 + /// + /// 主键 + /// 审核状态 + /// + [HttpPost] + [AjaxOnly] + public ActionResult CheckForm(string keyValue, int ClassStatus) + { + stuVolunteerIBLL.CheckForm(keyValue, ClassStatus); + return Success("审核成功!"); + } + /// + /// 生成学籍 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult GenerateStu() + { + stuVolunteerIBLL.GenerateStu(); + return Success("生成成功!"); + } + #endregion @@ -270,7 +328,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SubmitForm(string keyValue, string strEntity) { StuVolunteerEntity entity = strEntity.ToObject(); - + stuVolunteerIBLL.SaveEntity(keyValue, entity); return Success("提交成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.cshtml new file mode 100644 index 000000000..2a1f41df1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.cshtml @@ -0,0 +1,11 @@ +@{ + ViewBag.Title = "分班"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
班级
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.js new file mode 100644 index 000000000..5acba0529 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/ClassForm.js @@ -0,0 +1,52 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-16 10:14 + * 描 述:长阳迎新 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var data = $('body').lrGetFormData(); + var postData = { + ClassNo: data.ClassNo + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/SaveClassForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.cshtml new file mode 100644 index 000000000..c08fae7f2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.cshtml @@ -0,0 +1,79 @@ +@{ + ViewBag.Title = "生成学籍--编辑"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学生姓名*
+ +
+
+
性别*
+
+
+
+
学号
+ +
+
+
学籍号
+ +
+
+
县区名称*
+ +
+
+
毕业学校*
+ +
+
+
初中学号*
+ +
+
+
报名号*
+ +
+
+
中考总分*
+ +
+
+
身份证号*
+ +
+
+
录取意向(本校)*
+
+
+
+
第一意向
+
+
+
+
第二意向
+
+
+
+
第三意向
+
+
+
+
是否服从安排
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.js new file mode 100644 index 000000000..4d5bfd422 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/FormGenerate.js @@ -0,0 +1,59 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-16 10:14 + * 描 述:长阳迎新 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#IsCYSchool').lrDataItemSelect({ code: 'YesOrNoBit' }); + $('#IsPlan').lrDataItemSelect({ code: 'YesOrNoBit' }); + $('#Sex').lrDataItemSelect({ code: 'usersex' }); + + $('#MajorOne').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#MajorThree').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#MajorTwo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.cshtml index 2d01393ce..687099312 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "长阳迎新"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
@@ -11,20 +11,24 @@
-
县区名称
- +
学生姓名
+
-
毕业学校
- +
第一意向
+
-
-
学生姓名
- +
+
第二意向
+
+
+
+
第三意向
+
-
-
性别
-
+
+
班级
+
@@ -35,9 +39,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.js index f71a16f55..54c1e3b24 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexDivide.js @@ -17,57 +17,43 @@ var bootstrap = function ($, learun) { page.search(queryJson); }, 220, 400); $('#Sex').lrDataItemSelect({ code: 'usersex' }); + $('#MajorOne').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#MajorTwo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#MajorThree').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - // 录取 - $('#lr_enroll').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('ID'); - if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认录取选中项!', function (res) { - if (res) { - learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/EnrollForm', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); - } - }); - // 取消录取 - $('#lr_cancel').on('click', function () { + + //分班--选择班级 + $('#lr_divide').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); - if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认取消录取选中项!', function (res) { - if (res) { - learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/CancelForm', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); + + //审核分班状态 + var ClassStatus = $('#gridtable').jfGridValue('ClassStatus'); + if (ClassStatus.indexOf('1') != -1) { + learun.alert.warning("选中记录包含审核通过的数据!"); + return; } + learun.layerForm({ + id: 'classform', + title: '选择班级', + url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/ClassForm?keyValue=' + keyValue, + width: 400, + height: 300, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); }); + }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetPageList', headData: [ - //{ - // label: "是否录取", name: "IsEnroll", width: 80, align: "left", - // formatter: function (cellvalue) { - // return cellvalue == true ? "" : - // ""; - // } - //}, - { - label: "录取意向(本校)", name: "IsCYSchool", width: 100, align: "left", - formatter: function (cellvalue) { - return cellvalue == true ? "" : - ""; - } - }, - { label: "中考总分", name: "StuScore", width: 100, align: "left" }, { label: "学生姓名", name: "StuName", width: 100, align: "left" }, { label: "性别", name: "Sex", width: 80, align: "left", @@ -81,31 +67,79 @@ var bootstrap = function ($, learun) { }); } }, + { label: "中考总分", name: "StuScore", width: 100, align: "left" }, { label: "身份证号", name: "CardNo", width: 150, align: "left" }, - { label: "县区名称", name: "Address", width: 150, align: "left" }, - { label: "毕业学校", name: "BySchool", width: 150, align: "left" }, - { label: "初中学号", name: "H_SchoolNo", width: 150, align: "left" }, - { label: "报名号", name: "ApplyNo", width: 150, align: "left" }, - { label: "第一志愿", name: "FirstVolunteer", width: 120, align: "left" }, - { label: "第二志愿", name: "SecondVolunteer", width: 120, align: "left" }, - { label: "第三志愿", name: "ThirdVolunteer", width: 120, align: "left" }, - { label: "第四志愿", name: "FouthVolunteer", width: 120, align: "left" }, - { label: "第五志愿", name: "FifthVolunteer", width: 120, align: "left" }, - { label: "第六志愿", name: "SixthVolunteer", width: 120, align: "left" }, - { label: "第七志愿", name: "SeventhVolunteer", width: 120, align: "left" }, - { label: "第八志愿", name: "EighthVolunteer", width: 120, align: "left" }, - { label: "第九志愿", name: "NinthVolunteer", width: 120, align: "left" }, + { + label: "第一意向", name: "MajorOne", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "第二意向", name: "MajorTwo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "第三意向", name: "MajorThree", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "ClassNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { + label: "审核状态", name: "ClassStatus", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == 1 ? "审核通过" : + cellvalue == 0 ? "待审核" : ""; + } + }, + { label: "学号", name: "StuNo", width: 150, align: "left" }, { label: "备注", name: "Demo", width: 100, align: "left" }, ], mainId: 'ID', isPage: true, isMultiselect: true - }); page.search(); }, search: function (param) { param = param || {}; + param.SqlParameter = " and IsEnroll=1 and EnrollStatus=1"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.cshtml new file mode 100644 index 000000000..96e4e53f3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.cshtml @@ -0,0 +1,69 @@ +@{ + ViewBag.Title = "生成学籍"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学生姓名
+ +
+
+
学号
+ +
+
+
学籍号
+ +
+
+
专业
+
+
+
+
班级
+
+
+
+
分班审核
+ +
+
+
学籍状态
+ +
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.js new file mode 100644 index 000000000..dc0bd1ae0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexGenerate.js @@ -0,0 +1,182 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-16 10:14 + * 描 述:长阳迎新 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + // 审核 + $('#lr_check').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + + //审核分班状态 + var ClassStatus = $('#gridtable').jfGridValue('ClassStatus'); + if (ClassStatus.indexOf('1') != -1) { + learun.alert.warning("选中记录包含审核通过的数据!"); + return; + } + + learun.layerConfirm('是否确认审核选中记录!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/CheckForm', { keyValue: keyValue, ClassStatus: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 去审核 + $('#lr_nocheck').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + + //审核分班状态 + var ClassStatus = $('#gridtable').jfGridValue('ClassStatus'); + if (ClassStatus.indexOf('0') != -1) { + learun.alert.warning("选中记录包含待审核的数据!"); + return; + } + + learun.layerConfirm('是否确认去审选中记录!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/CheckForm', { keyValue: keyValue, ClassStatus: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } + var ClassStatus = $('#gridtable').jfGridValue('ClassStatus'); + if (ClassStatus == '1') { + learun.alert.warning("选中项已审核,不可编辑!"); + return; + } + + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/FormGenerate?keyValue=' + keyValue, + width: 820, + height: 600, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + + // 生成学籍 + $('#lr_stuCode').on('click', function () { + learun.layerConfirm('是否确认生成学籍!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GenerateStu', { }, function () { + refreshGirdData(); + }); + } + }); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetPageList', + headData: [ + { label: "学号", name: "StuNo", width: 150, align: "left" }, + { label: "学籍号", name: "StuCode", width: 150, align: "left" }, + { + label: "学籍状态", name: "StuCodeStatus", width: 80, align: "left", + formatter: function (value) { + return value == '1' ? "已生成" : + "未生成"; + } + }, + { label: "学生姓名", name: "StuName", width: 100, align: "left" }, + { + label: "性别", name: "Sex", width: 80, align: "left", + formatter: function (value) { + return value == '1' ? "男" : value == '0' ? "女" : ""; + } + }, + { label: "中考总分", name: "StuScore", width: 100, align: "left" }, + { label: "身份证号", name: "CardNo", width: 150, align: "left" }, + { + label: "专业", name: "MajorNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "ClassNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { + label: "审核状态", name: "ClassStatus", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == 1 ? "审核通过" : + cellvalue == 0 ? "待审核" : ""; + } + }, + { label: "备注", name: "Demo", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + isMultiselect: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.SqlParameter = " and ClassNo is not null "; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.cshtml deleted file mode 100644 index 8cd0d2ad8..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.cshtml +++ /dev/null @@ -1,48 +0,0 @@ -@{ - ViewBag.Title = "长阳迎新"; - Layout = "~/Views/Shared/_Index.cshtml"; -} -
-
-
-
-
-
-
-
-
-
县区名称
- -
-
-
毕业学校
- -
-
-
学生姓名
- -
-
-
性别
-
-
-
-
-
-
- -
-
-
-
-
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.js deleted file mode 100644 index f71a16f55..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/IndexStatus.js +++ /dev/null @@ -1,116 +0,0 @@ -/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) - * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 - * 创建人:超级管理员 - * 日 期:2021-12-16 10:14 - * 描 述:长阳迎新 - */ -var refreshGirdData; -var bootstrap = function ($, learun) { - "use strict"; - var page = { - init: function () { - page.initGird(); - page.bind(); - }, - bind: function () { - $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { - page.search(queryJson); - }, 220, 400); - $('#Sex').lrDataItemSelect({ code: 'usersex' }); - // 刷新 - $('#lr_refresh').on('click', function () { - location.reload(); - }); - // 录取 - $('#lr_enroll').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('ID'); - if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认录取选中项!', function (res) { - if (res) { - learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/EnrollForm', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); - } - }); - // 取消录取 - $('#lr_cancel').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('ID'); - if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认取消录取选中项!', function (res) { - if (res) { - learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuVolunteer/CancelForm', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); - } - }); - }, - // 初始化列表 - initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetPageList', - headData: [ - //{ - // label: "是否录取", name: "IsEnroll", width: 80, align: "left", - // formatter: function (cellvalue) { - // return cellvalue == true ? "" : - // ""; - // } - //}, - { - label: "录取意向(本校)", name: "IsCYSchool", width: 100, align: "left", - formatter: function (cellvalue) { - return cellvalue == true ? "" : - ""; - } - }, - { label: "中考总分", name: "StuScore", width: 100, align: "left" }, - { label: "学生姓名", name: "StuName", width: 100, align: "left" }, - { - label: "性别", name: "Sex", width: 80, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'usersex', - callback: function (_data) { - callback(_data.text); - } - }); - } - }, - { label: "身份证号", name: "CardNo", width: 150, align: "left" }, - { label: "县区名称", name: "Address", width: 150, align: "left" }, - { label: "毕业学校", name: "BySchool", width: 150, align: "left" }, - { label: "初中学号", name: "H_SchoolNo", width: 150, align: "left" }, - { label: "报名号", name: "ApplyNo", width: 150, align: "left" }, - { label: "第一志愿", name: "FirstVolunteer", width: 120, align: "left" }, - { label: "第二志愿", name: "SecondVolunteer", width: 120, align: "left" }, - { label: "第三志愿", name: "ThirdVolunteer", width: 120, align: "left" }, - { label: "第四志愿", name: "FouthVolunteer", width: 120, align: "left" }, - { label: "第五志愿", name: "FifthVolunteer", width: 120, align: "left" }, - { label: "第六志愿", name: "SixthVolunteer", width: 120, align: "left" }, - { label: "第七志愿", name: "SeventhVolunteer", width: 120, align: "left" }, - { label: "第八志愿", name: "EighthVolunteer", width: 120, align: "left" }, - { label: "第九志愿", name: "NinthVolunteer", width: 120, align: "left" }, - { label: "备注", name: "Demo", width: 100, align: "left" }, - ], - mainId: 'ID', - isPage: true, - isMultiselect: true - - }); - page.search(); - }, - search: function (param) { - param = param || {}; - $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); - } - }; - refreshGirdData = function () { - $('#gridtable').jfGridSet('reload'); - }; - page.init(); -} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index c52f76814..0dbd4a567 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1,4 +1,4 @@ - + @@ -1091,14 +1091,16 @@ + + + - @@ -7498,13 +7500,15 @@ - + + + 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 ede4cda78..a3bfc2d9d 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 @@ -119,6 +119,70 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 分班 + /// + /// + /// + public void SaveClassForm(string keyValue, string ClassNo) + { + try + { + stuVolunteerService.SaveClassForm(keyValue, ClassNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void CheckForm(string keyValue,int ClassStatus) + { + try + { + stuVolunteerService.CheckForm(keyValue, ClassStatus); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 生成学籍 + /// + public void GenerateStu() + { + try + { + stuVolunteerService.GenerateStu(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs index 600467237..1c789d662 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs @@ -30,6 +30,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("STUCODE")] public string StuCode { get; set; } /// + /// 学籍状态 + /// + [Column("STUCODESTATUS")] + public int? StuCodeStatus { get; set; } + /// /// 毕业学校 /// [Column("BYSCHOOL")] @@ -185,17 +190,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("STUNO")] public string StuNo { get; set; } /// - /// 专业一 + /// 第一意向 /// [Column("MAJORONE")] public string MajorOne { get; set; } /// - /// 专业二 + /// 第二意向 /// [Column("MAJORTWO")] public string MajorTwo { get; set; } /// - /// 专业三 + /// 第三意向 /// [Column("MAJORTHREE")] public string MajorThree { get; set; } @@ -204,6 +209,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("CLASSNO")] public string ClassNo { get; set; } + /// + /// 班级--分班审核状态 + /// + [Column("CLASSSTATUS")] + public int? ClassStatus { get; set; } ///// ///// 是否提交专业 ///// 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 de0407f16..66913ef6c 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 @@ -42,6 +42,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// 实体 void SaveEntity(string keyValue, StuVolunteerEntity entity); + + /// + /// 分班 + /// + /// + /// + void SaveClassForm(string keyValue, string ClassNo); + void CheckForm(string keyValue, int ClassStatus); + void GenerateStu(); #endregion #region 扩展数据 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 8f0ac1658..ecd900a2c 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 @@ -32,7 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" * "); + strSql.Append(@" t.* "); strSql.Append(" FROM StuVolunteer t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -53,6 +53,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); strSql.Append(" AND t.StuName Like @StuName "); } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuNo Like @StuNo "); + } + if (!queryParam["StuCode"].IsEmpty()) + { + dp.Add("StuCode", "%" + queryParam["StuCode"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuCode Like @StuCode "); + } if (!queryParam["Sex"].IsEmpty()) { dp.Add("Sex", queryParam["Sex"].ToString(), DbType.String); @@ -63,6 +73,41 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("CardNo", queryParam["CardNo"].ToString(), DbType.String); strSql.Append(" AND t.CardNo = @CardNo "); } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.ClassNo = @ClassNo "); + } + if (!queryParam["ClassStatus"].IsEmpty()) + { + dp.Add("ClassStatus", queryParam["ClassStatus"].ToString(), DbType.String); + strSql.Append(" AND t.ClassStatus = @ClassStatus "); + } + if (!queryParam["StuCodeStatus"].IsEmpty()) + { + dp.Add("StuCodeStatus", queryParam["StuCodeStatus"].ToString(), DbType.String); + strSql.Append(" AND t.StuCodeStatus = @StuCodeStatus "); + } + + if (!queryParam["MajorOne"].IsEmpty()) + { + dp.Add("MajorOne", queryParam["MajorOne"].ToString(), DbType.String); + strSql.Append(" AND t.MajorOne = @MajorOne "); + } + if (!queryParam["MajorTwo"].IsEmpty()) + { + dp.Add("MajorTwo", queryParam["MajorTwo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorTwo = @MajorTwo "); + } + if (!queryParam["MajorThree"].IsEmpty()) + { + dp.Add("MajorThree", queryParam["MajorThree"].ToString(), DbType.String); + strSql.Append(" AND t.MajorThree = @MajorThree "); + } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) @@ -171,6 +216,132 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 分班 + /// + /// + /// + public void SaveClassForm(string keyValue, string ClassNo) + { + try + { + var classinfo = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classinfo != null) + { + var arr = keyValue.Split(',').ToList(); + foreach (var id in arr) + { + var stuNo = GetStuNo(); + string sql = $"update StuVolunteer set StuNo='{stuNo}' ,ClassNo='{ClassNo}', DeptNo='{classinfo.DeptNo}',MajorNo='{classinfo.MajorNo}',ClassStatus=0 where ID='{id}' and (StuNo is null or len(StuNo)=0); update StuVolunteer set ClassNo='{ClassNo}', DeptNo='{classinfo.DeptNo}',MajorNo='{classinfo.MajorNo}',ClassStatus=0 where ID='{id}' and (StuNo is not null or len(StuNo)>0)"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + + } + } + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 审核分班 + /// + /// + /// 分班是否审核通过 + public void CheckForm(string keyValue, int ClassStatus) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','", keyValue.Split(',')); + } + + string sql = $"update StuVolunteer set ClassStatus={ClassStatus} where ID in ('{keyValue}')"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取学号 + /// + /// + private string GetStuNo() + { + //当前学年 + var year = Common.GetSemesterAndYear().AcademicYearShort.Substring(0, 2); + var StuNo = year + "36442000004"; + var maxSql = $"select Max(StuNo) as StuNo from StuVolunteer where StuNo like '{StuNo}%'"; + var maxStuNo = this.BaseRepository("CollegeMIS").FindObject(maxSql); + if (maxStuNo == null || string.IsNullOrEmpty(maxStuNo.ToString())) + { + StuNo = StuNo + "00001"; + } + else + { + int lastNum = int.Parse(maxStuNo.ToString().Substring(maxStuNo.ToString().Length - 5, 5)); + lastNum++; + StuNo = StuNo + lastNum.ToString("00000"); + } + + return StuNo; + } + + /// + /// 生成学籍 + /// + public void GenerateStu() + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //只生成分班审核通过 + string updSql = $"update [dbo].[StuVolunteer] set StuCode='G'+CardNo, StuCodeStatus=1 where ClassStatus=1"; + db.ExecuteBySql(updSql); + + string addSql = @"insert into StuInfoBasic ( +Stuid,StuNo,StuCode,ClassNo,StuName,GenderNo,DeptNo,MajorNo,IdentityCardNo,ExamScore +) +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.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 扩展代码 @@ -407,7 +578,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// /// 获取StuVolunteer表实体数据