From 6bc8b8cd180eeb05f5b6a705bf7004ccd38dc3b1 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Thu, 26 Nov 2020 18:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=AD=A6?= =?UTF-8?q?=E7=B1=8D=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=A6=E7=94=9F=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=9B=E5=AD=A6=E7=94=9F=E5=A4=84=E5=88=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E8=A7=A3=E9=99=A4?= =?UTF-8?q?=E5=A4=84=E5=88=86=E3=80=81=E8=A7=A3=E9=99=A4=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=EF=BC=9B=E2=80=9C=E5=AD=A6=E5=AD=90=E5=9C=A8=E7=BA=BF=E2=80=9D?= =?UTF-8?q?=E3=80=81=E2=80=9C=E5=AD=A6=E5=B7=A5=E4=BF=A1=E6=81=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E2=80=9D=E5=A2=9E=E5=8A=A0=E5=AD=A6=E7=94=9F=E8=AF=BE?= =?UTF-8?q?=E8=A1=A8=E8=AF=B7=E5=81=87=E7=AE=A1=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuAttendanceLeaveController.cs | 12 +- .../Controllers/StuPunishmentController.cs | 24 ++- .../Views/StuAttendanceLeave/Index.cshtml | 6 +- .../Views/StuAttendanceLeave/Index.js | 88 ++++---- .../StuAttendanceLeave/IndexInStudent.cshtml | 53 +++++ .../StuAttendanceLeave/IndexInStudent.js | 193 ++++++++++++++++++ .../Views/StuInfoBasic/Index.js | 3 + .../Views/StuPunishment/Index.cshtml | 2 + .../Views/StuPunishment/Index.js | 62 +++++- .../Learun.Application.Web.csproj | 2 + .../StuAttendanceLeaveEntity.cs | 14 +- .../StuAttendanceLeaveService.cs | 65 ++---- .../StuPunishment/StuPunishmentBLL.cs | 24 +++ .../StuPunishment/StuPunishmentEntity.cs | 14 +- .../StuPunishment/StuPunishmentIBLL.cs | 7 + .../StuPunishment/StuPunishmentService.cs | 47 ++++- 16 files changed, 498 insertions(+), 118 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs index b1985e593..bd26f7a65 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuAttendanceLeaveController.cs @@ -40,14 +40,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } - - - [HttpGet] public ActionResult CheckForm() { return View(); } + /// + /// 主页面【学子在线】 + /// + /// + [HttpGet] + public ActionResult IndexInStudent() + { + return View(); + } #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuPunishmentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuPunishmentController.cs index a545c1b9d..569c7f202 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuPunishmentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuPunishmentController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -69,8 +69,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var StuPunishmentData = stuPunishmentIBLL.GetStuPunishmentEntity( keyValue ); - var jsonData = new { + var StuPunishmentData = stuPunishmentIBLL.GetStuPunishmentEntity(keyValue); + var jsonData = new + { StuPunishment = StuPunishmentData, }; return Success(jsonData); @@ -102,9 +103,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { StuPunishmentEntity entity = strEntity.ToObject(); - stuPunishmentIBLL.SaveEntity(keyValue,entity); + stuPunishmentIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 解除处分 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCancelPunish(string keyValue, bool status) + { + stuPunishmentIBLL.DoCancelPunish(keyValue, status); + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.cshtml index 61a8721a1..e030f4e13 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.cshtml @@ -38,10 +38,10 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.js index 931605daa..41d9d0be8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/Index.js @@ -16,33 +16,33 @@ var bootstrap = function ($, learun) { }, bind: function () { page.search(); - //// 时间搜索框 - //$('#datesearch').lrdate({ - // dfdata: [ - // { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - // { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - // { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, - // { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } - // ], - // // 月 - // mShow: false, - // premShow: false, - // // 季度 - // jShow: false, - // prejShow: false, - // // 年 - // ysShow: false, - // yxShow: false, - // preyShow: false, - // yShow: false, - // // 默认 - // dfvalue: '1', - // selectfn: function (begin, end) { - // startTime = begin; - // endTime = end; - // page.search(); - // } - //}); + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); @@ -97,16 +97,16 @@ var bootstrap = function ($, learun) { var keyValue = $("#gridtable").jfGridValue('ID'); if (learun.checkrow(keyValue)) { var check = $("#gridtable").jfGridValue('IsCheck'); - if (check != null) { - learun.alert.warning("已经审核过了"); + if (check == "1") { + learun.alert.warning("该项已审核同意!"); return false; } else { learun.layerForm({ - id: 'form', + id: 'checkform', title: '审核', url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/CheckForm?keyValue=' + keyValue, - width: 600, - height: 400, + width: 1200, + height: 800, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -126,7 +126,7 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/GetPageList', headData: [ - { label: "学年度", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "申请时间", name: "UpdateDate", width: 100, align: "left" }, { label: "审核状态", name: "IsCheck", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -134,11 +134,25 @@ var bootstrap = function ($, learun) { key: value, code: 'LeaveCheck', callback: function (_data) { - callback(_data.text ? _data.text : "未审核"); + callback(_data.text ? _data.text : "申请中"); } }); } }, + { label: "审核备注", name: "TecRemark", width: 100, align: "left" }, + { + label: "请假类型", name: "LeaveType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'LeaveType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, { label: "学期", name: "Semester", width: 100, align: "left" }, { label: "学号", name: "StuNo", width: 100, align: "left" }, { label: "姓名", name: "StuName", width: 100, align: "left" }, @@ -155,18 +169,20 @@ var bootstrap = function ($, learun) { { label: "课程类别", name: "LessonSortName", width: 100, align: "left" }, { label: "原上课日期", name: "LessonDate", width: 100, align: "left" }, { label: "上课时间", name: "LessonTime", width: 100, align: "left" }, - { label: "请假类型", name: "LeaveType", width: 100, align: "left" }, { label: "教师号", name: "EmpNo", width: 100, align: "left" }, { label: "备注", name: "Remark", width: 100, align: "left" }, ], mainId: 'ID', - isPage: true + isPage: true, + sord: 'UpdateDate desc' }); + page.search(); }, search: function (param) { param = param || {}; param.StartTime = startTime; param.EndTime = endTime; + param.ClassManagerNo = learun.clientdata.get(['userinfo']).account; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.cshtml new file mode 100644 index 000000000..214bbfa4f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.cshtml @@ -0,0 +1,53 @@ +@{ + ViewBag.Title = "学生请假记录"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+ @*
+
+
*@ +
+
+
+
+
课程名称
+ +
+
+
年级
+ +
+
+
姓名
+ +
+
+
教师号
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.js new file mode 100644 index 000000000..725b721ab --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuAttendanceLeave/IndexInStudent.js @@ -0,0 +1,193 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-05-24 15:40 + * 描 述:学生请假记录 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + page.search(); + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //审核 + $("#lr_check").on('click', function () { + var keyValue = $("#gridtable").jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var check = $("#gridtable").jfGridValue('IsCheck'); + if (check == "1") { + learun.alert.warning("该项已审核同意!"); + return false; + } else { + learun.layerForm({ + id: 'checkform', + title: '审核', + url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/CheckForm?keyValue=' + keyValue, + width: 1200, + height: 800, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + + } + } + + }) + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuAttendanceLeave/GetPageList', + headData: [ + { label: "申请时间", name: "UpdateDate", width: 100, align: "left" }, + { + label: "审核状态", name: "IsCheck", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'LeaveCheck', + callback: function (_data) { + callback(_data.text ? _data.text : "申请中"); + } + }); + } + }, + { label: "审核备注", name: "TecRemark", width: 100, align: "left" }, + { + label: "请假类型", name: "LeaveType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'LeaveType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { label: "学号", name: "StuNo", width: 100, align: "left" }, + { label: "姓名", name: "StuName", width: 100, align: "left" }, + { label: "年级", name: "Grade", width: 100, align: "left" }, + { label: "系所码", name: "DeptNo", width: 100, align: "left" }, + { label: "系名", name: "DeptName", width: 100, align: "left" }, + { label: "专业码", name: "MajorNo", width: 100, align: "left" }, + { label: "专业名", name: "MajorName", width: 100, align: "left" }, + { label: "所在行政班号 ", name: "ClassNo", width: 100, align: "left" }, + { label: "班级名称", name: "ClassName", width: 100, align: "left" }, + { label: "课程号", name: "LessonNo", width: 100, align: "left" }, + { label: "课程名称", name: "LessonName", width: 100, align: "left" }, + { label: "课程类别码", name: "LessonSortNo", width: 100, align: "left" }, + { label: "课程类别", name: "LessonSortName", width: 100, align: "left" }, + { label: "原上课日期", name: "LessonDate", width: 100, align: "left" }, + { label: "上课时间", name: "LessonTime", width: 100, align: "left" }, + { label: "教师号", name: "EmpNo", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true, + sord: 'UpdateDate desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + param.StuNo = learun.clientdata.get(['userinfo']).account; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js index 66696492e..367bc0204 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.js @@ -337,6 +337,9 @@ var bootstrap = function ($, learun) { { label: "入学年月", name: "EntranceDate", width: 100, align: "left" }, { label: "余额", name: "Balance", width: 100, align: "left" }, { label: "通信地址", name: "MailAddress", width: 100, align: "left" }, + { label: "联系电话", name: "mobile", width: 100, align: "left" }, + { label: "户口所在地", name: "FatherUnit", width: 100, align: "left" }, + { label: "档案所在地", name: "MatherUnit", width: 100, align: "left" }, { label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center", formatter: function (cellvalue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml index ed49f1d91..ca70f343d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.cshtml @@ -16,6 +16,8 @@  录入  修改  删除 +  解除处分 +  取消解除处分 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js index 36441a127..bbf1a4f12 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuPunishment/Index.js @@ -19,7 +19,7 @@ var bootstrap = function ($, learun) { }); // 新增 $('#lr_add').on('click', function () { - learun.layerForm({ + learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/Form', @@ -50,9 +50,45 @@ var bootstrap = function ($, learun) { $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认删除该项!', function (res) { + learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 解除处分 + $('#lr_cancelPunish').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var status = $('#gridtable').jfGridValue('IsCancelPunish'); + if (status == true) { + learun.alert.warning("该项已解除处分!"); + return false; + } + learun.layerConfirm('是否确认解除处分该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: true }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 取消解除处分 + $('#lr_cancelPunishNot').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var status = $('#gridtable').jfGridValue('IsCancelPunish'); + if (status != true) { + learun.alert.warning("该项未解除处分,无法取消解除!"); + return false; + } + learun.layerConfirm('是否确认取消解除处分该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuPunishment/DoCancelPunish', { keyValue: keyValue, status: false }, function () { refreshGirdData(); }); } @@ -65,23 +101,29 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuPunishment/GetPageList', headData: [ - { label: "学号", name: "StuNo", width: 100, align: "left"}, - { label: "姓名", name: "StuName", width: 100, align: "left"}, + { label: "学号", name: "StuNo", width: 100, align: "left" }, + { label: "姓名", name: "StuName", width: 100, align: "left" }, { label: "处分名称", name: "PunishName", width: 100, align: "left" }, - { label: "处分原因", name: "PunishReason", width: 100, align: "left"}, - { label: "处分日期", name: "PunishDate", width: 100, align: "left"}, - { label: "处分文号", name: "FileNo", width: 100, align: "left"}, + { label: "处分原因", name: "PunishReason", width: 100, align: "left" }, + { label: "处分日期", name: "PunishDate", width: 100, align: "left" }, + { label: "处分文号", name: "FileNo", width: 100, align: "left" }, + { + label: "是否解除处分", name: "IsCancelPunish", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, + { label: "解除处分日期", name: "CancelPunishDate", width: 100, align: "left" }, ], - mainId:'Id', + mainId: 'Id', isPage: true }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { 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 f28456852..7b4eea4d8 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 @@ -943,6 +943,7 @@ + @@ -6872,6 +6873,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveEntity.cs index 1711053a0..9f6b95990 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveEntity.cs @@ -166,7 +166,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public DateTime? UpdateDate { get; set; } /// - /// 审核状态 + /// 审核状态(0请假申请中1请假通过2请假未通过) /// [Column("ISCHECK")] public string IsCheck { get; set; } @@ -216,5 +216,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion 扩展操作 + #region 扩展成员 + /// + /// 班级班主任 + /// + [NotMapped] + public string ClassDiredctorNo { get; set; } + /// + /// 班级辅导员 + /// + [NotMapped] + public string ClassTutorNo { get; set; } + #endregion } } \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveService.cs index 6705efa30..fbce92265 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuAttendanceLeave/StuAttendanceLeaveService.cs @@ -30,34 +30,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.ID, - t.AcademicYearNo, - t.Semester, - t.StuNo, - t.StuName, - t.Grade, - t.DeptNo, - t.DeptName, - t.MajorNo, - t.MajorName, - t.ClassNo, - t.ClassName, - t.LessonNo, - t.LessonName, - t.TeachClassNo, - t.LessonSortNo, - t.LessonSortName, - t.LessonDate, - t.LessonTime, - t.LeaveType, - t.EmpNo, - t.Remark, - t.IsCheck, - t.TecRemark - "); - strSql.Append(" FROM StuAttendanceLeave t "); + strSql.Append("SELECT t.*,c.ClassDiredctorNo,c.ClassTutorNo "); + strSql.Append(" FROM StuAttendanceLeave t left join ClassInfo c on t.ClassNo=c.ClassNo "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -75,8 +49,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["Grade"].IsEmpty()) { - dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); - strSql.Append(" AND t.Grade Like @Grade "); + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND t.Grade = @Grade "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + strSql.Append(" AND t.StuNo = @StuNo "); } if (!queryParam["StuName"].IsEmpty()) { @@ -88,24 +67,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EmpNo", "%" + queryParam["EmpNo"].ToString() + "%", DbType.String); strSql.Append(" AND t.EmpNo Like @EmpNo "); } - var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); - //var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); - //获取登录帐号 - var userInfo = LoginUserInfo.Get(); - //获取当前帐号所管理的班级 - var classes = this.BaseRepository("CollegeMIS").FindList(a => a.ClassDiredctorNo == userInfo.account).Select(a => a.ClassNo); - var list = result.Where(a => classes.Contains(a.ClassNo)).ToList(); - return list; - //var stuSelectLessons = this.BaseRepository("CollegeMIS").FindList(a => a.EmpNo == userInfo.account).ToList(); - ////获取当前教师所教的课程 - //var lessons = stuSelectLessons.GroupBy(a => a.LessonNo).Select(a => a.Key).ToList(); - ////获取要上当前教师所教课程的学生 - //var students = stuSelectLessons.GroupBy(a => a.StuNo).Select(a => a.Key).ToList(); - //var list2 = result.Where(a => students.Contains(a.StuNo)) - // .Where(a => lessons.Contains(a.LessonNo)).ToList(); - //list.AddRange(list2); - //return list.Distinct().ToList(); + //班级班主任/辅导员 + if (!queryParam["ClassManagerNo"].IsEmpty()) + { + dp.Add("ClassManagerNo", queryParam["ClassManagerNo"].ToString(), DbType.String); + strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo) "); + } + var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + + return result; } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentBLL.cs index 73def66f4..d05838389 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentBLL.cs @@ -210,6 +210,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 解除处分 + /// 主键 + /// + /// + public void DoCancelPunish(string keyValue, bool status) + { + try + { + stuPunishmentService.DoCancelPunish(keyValue, status); + } + 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/StuPunishment/StuPunishmentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentEntity.cs index 69413f3ac..72fc3ddec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentEntity.cs @@ -47,7 +47,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("PUNISHNO")] public string PunishNo { get; set; } /// - /// PunishName + /// 处分名称 /// [Column("PUNISHNAME")] public string PunishName { get; set; } @@ -92,10 +92,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("CHECKMARK")] public string CheckMark { get; set; } /// - /// PunishmentDate + /// 处分日期 /// [Column("PUNISHMENTDATE")] public DateTime? PunishmentDate { get; set; } + /// + /// 是否解除处分 + /// + [Column("ISCANCELPUNISH")] + public bool? IsCancelPunish { get; set; } + /// + /// 解除处分日期 + /// + [Column("CANCELPUNISHDATE")] + public DateTime? CancelPunishDate { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentIBLL.cs index 36de75195..1c35cbc4e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentIBLL.cs @@ -67,6 +67,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPunishmentListByStuNo(string stuNo); + + /// + /// 解除处分 + /// 主键 + /// + /// + void DoCancelPunish(string keyValue, bool status); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs index db77dec3b..2f08ca743 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuPunishment/StuPunishmentService.cs @@ -30,17 +30,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.Id, - t.StuNo, - t.StuName, - t.PunishNo, - t.PunishName, - t.PunishReason, - t.PunishDate, - t.FileNo - "); + strSql.Append("SELECT t.* "); strSql.Append(" FROM StuPunishment t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -248,6 +238,41 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 解除处分 + /// 主键 + /// + /// + public void DoCancelPunish(string keyValue, bool status) + { + try + { + var keyvalue = Convert.ToInt32(keyValue); + if (status) + { + //解除处分 + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuPunishment set IsCancelPunish=1,CancelPunishDate='" + DateTime.Now + "' where Id= " + keyValue); + } + else + { + //取消解除处分 + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuPunishment set IsCancelPunish=0,CancelPunishDate=null where Id= " + keyValue); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion }