From 09a9e488b08f90c26ba1ccc47a712d9e4ec5bcfb Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 13 Nov 2023 15:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=8E=88?= =?UTF-8?q?=E8=AF=BE=E8=80=83=E5=8B=A4=E6=98=8E=E7=BB=86=EF=BC=9A=E8=80=83?= =?UTF-8?q?=E5=8B=A4=E6=97=B6=E9=97=B4=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=8C=83=E5=9B=B4=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StatisticDetailIndex.cshtml | 14 +++--- .../TeachAttendance/StatisticDetailIndex.js | 45 +++++++++++++------ .../TeachAttendance/TeachAttendanceService.cs | 21 +++++---- 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml index a941dcecb..fa0aab9f8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.cshtml @@ -2,23 +2,23 @@ ViewBag.Title = "授课考勤明细统计"; Layout = "~/Views/Shared/_Index.cshtml"; } +
- @*
- -
-
-  查询 -
*@
考勤时间
- + @**@ +
职工编号
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js index 14b943e96..d0c580872 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachAttendance/StatisticDetailIndex.js @@ -7,7 +7,8 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; - //var date = ""; + var startTime; + var endTime; var page = { init: function () { page.initGird(); @@ -17,22 +18,39 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 250, 400); + // 时间搜索框 + $('#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: '0', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + } + }); //当前年 - var now = learun.formatDate(new Date(), 'yyyy-MM-dd'); - $('#Date').val(now); + //var now = learun.formatDate(new Date(), 'yyyy-MM-dd'); + //$('#Date').val(now); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - //查询 - //$('#btn_Search').on('click', function () { - // date = $('#date').val(); - // if (date == null || date == undefined || date == "") { - // learun.alert.warning("请选择查询时间!"); - // return; - // } - // page.search(); - //}); // 部门选择 $('#F_DepartmentId').lrselect({ type: 'tree', @@ -135,7 +153,8 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; - //param.Date = date; + param.startTime = startTime; + param.endTime = endTime; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachAttendance/TeachAttendanceService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachAttendance/TeachAttendanceService.cs index 09c1d03dd..d0f614708 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachAttendance/TeachAttendanceService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachAttendance/TeachAttendanceService.cs @@ -124,24 +124,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var queryParam = queryJson.ToJObject(); - var date = DateTime.Now.ToDateString(); - if (!queryParam["Date"].IsEmpty()) + var datest = DateTime.Now.ToDateString(); + var dateet = datest; + if (!queryParam["startTime"].IsEmpty()) { - date = queryParam["Date"].ToDate().ToDateString(); + datest = queryParam["startTime"].ToDate().ToDateString(); + } + if (!queryParam["endTime"].IsEmpty()) + { + dateet = queryParam["endTime"].ToDate().ToDateString(); } var strSql1 = $@"select a.ALTId as ALTIdInArrange,a.LessonDate,a.AcademicYearNo,a.Semester, a.LessonNo, a.LessonName, a.EmpNo as EmpNoInArrange, a.EmpName as EmpNameInArrange,a.ClassroomNo,a.LessonTime, a.StartTime, a.EndTime,a.LessonSortNo as LessonSortNoInArrange,e.F_DepartmentId,t.* from ArrangeLessonTerm a left join Teach_Attendance t on a.ALTId=t.ALTId and t.LessonSortNo='1' left join EmpInfo e on a.EmpNo=e.EmpNo - where a.LessonDate ='{date}'"; + where a.LessonDate >='{datest}' and a.LessonDate <= '{dateet}'"; var strSql2 = $@"select a.Id as ALTIdInArrange,a.LessonDate,a.AcademicYearNo, a.Semester, a.LessonNo, a.LessonName,a.EmpNo as EmpNoInArrange, a.EmpName as EmpNameInArrange,a.ClassRoomNo as ClassroomNo,a.LessonSection as LessonTime, case when LEN(a.LessonTime)>0 then SUBSTRING(a.LessonTime,1,CHARINDEX('-',a.LessonTime)-1) else '' end as StartTime, case when LEN(a.LessonTime)>0 then SUBSTRING(a.LessonTime,CHARINDEX('-',a.LessonTime)+1,LEN(a.LessonTime)-CHARINDEX('-',a.LessonTime)) else '' end as EndTime, a.LessonSortNo as LessonSortNoInArrange,e.F_DepartmentId,t.* from ArrangeLessonTermOfElective a left join Teach_Attendance t on a.Id=t.ALTId and t.LessonSortNo='2' left join EmpInfo e on a.EmpNo=e.EmpNo - where a.LessonDate='{date}'"; + where a.LessonDate >='{datest}' and a.LessonDate <= '{dateet}'"; // 虚拟参数 var dp = new DynamicParameters(new { }); if (!queryParam["EmpNo"].IsEmpty()) @@ -220,15 +225,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ClockTime = y.ClockTime, ClockStatus = y.ClockStatus }).ToList() - }).OrderBy(x => x.EmpNoInArrange).OrderBy(x => Convert.ToInt32(x.LessonTime.Substring(1))); + }).OrderBy(x => x.LessonDate).ThenBy(x => Convert.ToInt32(x.LessonTime.Substring(1))); //结果列表 var result = new List(); foreach (var item in data) { //上课时间 - var WorkTimeTemp = string.Format("{0} {1}", date, item.StartTime).ToDate(); + var WorkTimeTemp = string.Format("{0} {1}", item.LessonDate, item.StartTime).ToDate(); //下课时间 - var CloseTimeTemp = string.Format("{0} {1}", date, item.EndTime).ToDate(); + var CloseTimeTemp = string.Format("{0} {1}", item.LessonDate, item.EndTime).ToDate(); //课程应工作分钟数 var WholeMinutes = (CloseTimeTemp - WorkTimeTemp).TotalMinutes.ToInt(); //上课