From df30112f41cd020805054be68734d60077263df3 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 28 Jul 2023 12:16:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E8=81=8C=E5=B7=A5=E8=AF=B7=E5=81=87?= =?UTF-8?q?=E5=8D=95=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/NWFProcessController.cs | 21 ++ .../Views/NWFProcess/TeachLeaveIndex.cshtml | 53 +++++ .../Views/NWFProcess/TeachLeaveIndex.js | 196 ++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../StudentLeave/StudentLeaveBLL.cs | 5 + .../StudentLeave/StudentLeaveIBLL.cs | 2 + .../StudentLeave/StudentLeaveService.cs | 40 ++++ 7 files changed, 319 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs index fe241dab6..e59b5bf5f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs @@ -355,6 +355,12 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers { return View(); } + [HttpGet] + public ActionResult TeachLeaveIndex() + { + return View(); + } + #endregion #region 获取数据 @@ -530,6 +536,21 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers }; return Success(jsonData); } + [HttpGet] + [AjaxOnly] + public ActionResult TeachLeaveStats(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var list = studentLeaveIBLL.TeachLeaveStats(paginationobj, queryJson); + var jsonData = new + { + rows = list, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records, + }; + return Success(jsonData); + } #endregion #region 保存更新删除 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.cshtml new file mode 100644 index 000000000..bf9400b59 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.cshtml @@ -0,0 +1,53 @@ +@{ + ViewBag.Title = "普通教师请假归档"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
姓名
+
+
+
+
所属部门
+
+
+
+
请假类型
+
+
+ @*
+
请假事由
+ +
*@ +
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.js") + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.js new file mode 100644 index 000000000..45b37973b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/TeachLeaveIndex.js @@ -0,0 +1,196 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:2021.05.18 + * 描 述:教职工请假 + */ +var bootstrap = function ($, learun) { + "use strict"; + var categoryId = '1'; + var logbegin = ''; + var logend = ''; + + var page = { + init: function () { + $('#lr_verify').hide(); + page.initGrid(); + page.bind(); + }, + bind: function () { + $('#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, + selectfn: function (begin, end) { + logbegin = begin; + logend = end; + page.search(); + } + }); + // 查询 + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#F_CreateUserName').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + $('#F_QJType').lrDataItemSelect({ code: 'LeaveType' }); + $('#F_BuMen').lrselect({ + type: 'tree', + // 展开最大高度 + maxHeight: 200, + // 是否允许搜索 + allowSearch: true, + // 访问数据接口地址 + url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 查看 + $('#lr_eye').on('click', function () { + page.eye(); + }); + }, + initleft: function () { + $('#lr_left_list li').on('click', function () { + var $this = $(this); + var $parent = $this.parent(); + $parent.find('.active').removeClass('active'); + $this.addClass('active'); + categoryId = $this.attr('data-value'); + if (categoryId == 3) { + categoryId = 1; + F_EnabledMark = true; + } else { + F_EnabledMark = false; + } + page.search(); + }); + }, + initGrid: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/TeachLeaveStats', + headData: [ + { + label: '姓名', name: 'F_CreateUserName', width: 80, align: "left", + formatterAsync: function (callback, value, row) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (item) { + callback(item.name); + } + }); + } + }, + { + label: '所属部门', name: 'F_BuMen', width: 120, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: '开始时间', name: 'StartDate', width: 140, align: "left", + formatter: function (cellvalue, row) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + } + }, + { + label: '上下午', name: 'F_shangxiawu', width: 60, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'sxw', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: '结束时间', name: 'EndDate', width: 140, align: "left", + formatter: function (cellvalue, row) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + } + }, + { + label: '上下午', name: 'F_sxw', width: 60, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'sxw', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + + { + label: '请假天数', name: 'F_tianshu', width: 60, align: "left", + statistics: true + }, + { + label: '请假类型', name: 'F_QJType', width: 80, 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: 'F_Description', width: 80, align: "left" }, + ], + mainId: 'SLId', + isPage: true, + sidx: 'F_CreateDate DESC', + //dblclick: function () { + // page.eye(); + //} + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = logbegin; + param.EndTime = logend; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + //eye: function () { + // var processId = $('#gridtable').jfGridValue('SLId') || ''; + // var title = $('#gridtable').jfGridValue('F_Description'); + + // if (learun.checkrow(processId)) { + // learun.frameTab.open({ F_ModuleId: 'monitor' + processId, F_FullName: '查看-' + title, F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/MonitorDetailsIndex?processId=' + processId }); + // } + //} + }; + + 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 fb004244e..631388c8f 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 @@ -1757,6 +1757,7 @@ + @@ -8115,6 +8116,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs index 90e88b3af..f3364e13e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs @@ -116,6 +116,11 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager } } + public IEnumerable TeachLeaveStats(Pagination pagination, string queryJson) + { + return studentLeaveService.TeachLeaveStats(pagination, queryJson); + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs index ef7a729b5..02dce26ed 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs @@ -42,6 +42,8 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager /// 主键 /// StudentLeaveEntity GetEntity(string keyValue); + + IEnumerable TeachLeaveStats(Pagination pagination, string queryJson); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs index 4dcc3425d..b8c47c07d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs @@ -240,6 +240,46 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager } } + public IEnumerable TeachLeaveStats(Pagination pagination, string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + var strSql = new StringBuilder(); + strSql.Append(@" select zb.* from StudentLeave zb + left join LR_NWF_PROCESS lnp on zb.slID = lnp.f_id + where F_IsFinished = 1 and lnp.F_EnabledMark != '3' and F_IsChild = '0' and F_IsStart = 1 "); + if (!queryParam["F_CreateUserName"].IsEmpty()) + { + strSql.Append(" and zb.F_CreateUserName = '" + queryParam["F_CreateUserName"].ToString() + "' "); + } + if (!queryParam["F_BuMen"].IsEmpty()) + { + strSql.Append(" and F_BuMen = '" + queryParam["F_BuMen"].ToString() + "' "); + } + if (!queryParam["F_QJType"].IsEmpty()) + { + strSql.Append(" and F_QJType = '" + queryParam["F_QJType"].ToString() + "' "); + } + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty() && (queryParam["StartTime"].ToString() != "1753-01-01" && queryParam["EndTime"].ToString() != "3000-01-01")) + { + strSql.Append(" AND ( starttime >= '" + queryParam["StartTime"].ToDate() + "' AND endtime <= '" + queryParam["EndTime"].ToDate() + "' ) "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据