From 6414c9dfa8145b293abb085ff34352c6d73d99cc Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Thu, 4 Jan 2024 16:58:43 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E8=AF=BE?= =?UTF-8?q?=E6=97=B6=E8=B4=B9=E7=BB=9F=E8=AE=A1=E5=8A=A0=E6=89=93=E5=8D=B0?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrangeLessonTermController.cs | 27 +++++ .../PrintCourseStatistic.cshtml | 82 ++++++++++++++ .../PrintCourseStatistic.css | 71 ++++++++++++ .../ArrangeLessonTerm/PrintCourseStatistic.js | 1 + .../ArrangeLessonTerm/coursestatictis.cshtml | 5 +- .../ArrangeLessonTerm/coursestatictis.js | 107 ++++++++++-------- .../Learun.Application.Web.csproj | 3 + .../ArrangeLessonTermService.cs | 17 +-- 8 files changed, 248 insertions(+), 65 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.css create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs index 7abc771c5..9a428b446 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs @@ -30,6 +30,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private UserIBLL userIbll = new UserBLL(); private WeChatConfigIBLL weChatConfigIbll = new WeChatConfigBLL(); private WeChatTempletIBLL weChatTempletIbll = new WeChatTempletBLL(); + private CdDeptIBLL cdDeptIBLL = new CdDeptBLL(); #region 视图功能 @@ -83,6 +84,32 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + /// + /// 课时统计打印 + /// + /// + [HttpGet] + public ActionResult PrintCourseStatistic(string weeks, string deptNo, string StartTime, string EndTime) + { + Pagination paginationobj = new Pagination() { rows = 100000, page = 1, sidx = "empno ", sord = "asc" }; + var queryJson = "{\"weeks\":\"" + weeks + "\",\"deptNo\":\"" + deptNo + "\",\"StartTime\":\"" + StartTime + "\",\"EndTime\":\"" + EndTime + "\"}"; + var data = arrangeLessonTermIBLL.GetcoursestatictisList(paginationobj, queryJson); + ViewBag.data = data; + ViewBag.startTime = StartTime; + ViewBag.endTime = EndTime; + ViewBag.deptName = ""; + if (!string.IsNullOrEmpty(deptNo)) + { + var deptEntity = cdDeptIBLL.GetCdDeptEntityByNo(deptNo); + if (deptEntity != null) + { + ViewBag.deptName = deptEntity.DeptName; + } + } + + return View(); + } #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.cshtml new file mode 100644 index 000000000..2ae8a56c7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.cshtml @@ -0,0 +1,82 @@ +@using Learun.Application.TwoDevelopment.EducationalAdministration +@{ + ViewBag.Title = "打印课时费统计"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + + + + + + Document + +@Html.AppendCssFile("/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.css") + +
+
+ 2023年黑龙江艺术职业学院______@ViewBag.deptName______系(部)校内专任教师_____月份课时费报表(@ViewBag.startTime.Substring(0, 10)-@ViewBag.endTime.Substring(0, 10)) +
+ @{ + var now = DateTime.Now; + } +
制表时间:@now.Year 年 @now.Month 月 @now.Day 日
+ + + + + + + + + + + + + @{ + List dataList = ViewBag.data; + } + @foreach (LessonStatictisEntity entity in dataList) + { + + + + + + + + @if (string.IsNullOrEmpty(entity.feestandard)) + { + + } + else + { + + } + + + + } +
序号
姓名
教师职务周任务课时(节)月课时(节)折算后月课时(节)课时费标准(元/节)实发课时费(元)备注
@(dataList.IndexOf(entity) + 1)
@entity.empname
@entity.zhiwu@entity.weekcourses@entity.monthactcourses@entity.zhesuan_monthactcourses@entity.feestandard¥@entity.feestandard¥@entity.actfeestandard
+
+ +
+
+ +
+
+ + + + +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.css new file mode 100644 index 000000000..9827e8631 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.css @@ -0,0 +1,71 @@ +@media print { + .noprint { + display: none !important; + } +} +body{ + padding:10px; +} +table { + text-align: center; + width: 100%; + font-size: 14px; + color: #464646; + background: #fff; + border: 1px solid #d0d9e8; + border-spacing: 0px; + border-collapse: collapse; +} + + table td, + table th { + padding: 14px 6px; + border: 1px solid #d0d9e8; + } + + table th { + color: #000; + font-weight: normal; + } + +.btnBox { + display: flex; + justify-content: center; + margin-top: 20px; +} + + .btnBox #print { + background-color: #d05051; + border: none; + color: #fff; + width: 80px; + line-height: 32px; + letter-spacing: 4px; + cursor: pointer; + } + +.tableTop { + color: #464646; + font-size: 14px; + margin-bottom: 6px; +} + +.makeTime { + text-align: right; + color: #666; + font-size: 14px; + line-height: 28px; +} + +.tableBottom ul { + display: flex; + flex-wrap: nowrap; + list-style-type: none; + padding-left: 0; + color: #464646; + font-size: 14px; +} + + .tableBottom ul li { + flex: 1; + } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.js new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/PrintCourseStatistic.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.cshtml index d16a0ec4a..989644eb5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.cshtml @@ -1,5 +1,5 @@ @{ - ViewBag.Title = "排课"; + ViewBag.Title = "课时费统计"; Layout = "~/Views/Shared/_Index.cshtml"; }
@@ -24,6 +24,9 @@
+
+  打印 +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.js index 810b8063f..1e3a31882 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/coursestatictis.js @@ -2,7 +2,7 @@ * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-02-27 11:05 - * 描 述:排课 + * 描 述:课时费统计 */ var selectedRow; var refreshGirdData; @@ -16,69 +16,77 @@ var bootstrap = function ($, learun) { page.bind(); }, bind: function () { - // 时间搜索框 $('#weeks').lrselect({ - placeholder:"请选择本月周数", - data: [{ text: "1周", value: "1" },{ text: "2周", value: "2" },{ text: "3周", value: "3" }, { text: "4周", value: "4" }], - text: "text", - value: "value", - }) - var monthdata = [] - for (var i = 1; i <= 12; i++) { - monthdata.push({ text: i+"月", value: i }) - } - $('#datesearch').lrselect({ - data: monthdata, + placeholder: "请选择本月周数", + data: [{ text: "1周", value: "1" }, { text: "2周", value: "2" }, { text: "3周", value: "3" }, { text: "4周", value: "4" }, { text: "5周", value: "5" }], text: "text", value: "value", }) $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); - //$('#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: '3', - // 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: '0', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + } + }); // 查询 $('#btn_Search').on('click', function () { - var month = $('#datesearch').lrselectGet(); var weeks = $('#weeks').lrselectGet(); + if (weeks == null || weeks == "" || weeks == undefined) { + learun.alert.warning("请选择本月周数!"); + return false; + } var deptNo = $('#DeptNo').lrselectGet(); - page.search({ month: month, weeks: weeks, deptNo: deptNo }); + page.search({ weeks: weeks, deptNo: deptNo }); }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); + // 打印 + $('#lr_print').on('click', function () { + var weeks = $('#weeks').lrselectGet(); + if (weeks == null || weeks == "" || weeks == undefined) { + learun.alert.warning("请选择本月周数!"); + return false; + } + learun.layerForm({ + id: 'PrintCourseStatistic', + title: '打印', + url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/PrintCourseStatistic?weeks=' + weeks + '&deptNo=' + $('#DeptNo').lrselectGet() + '&StartTime=' + startTime + '&EndTime=' + endTime, + width: 1200, + height: 800, + btn: null + }); + }); }, initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetcoursestatictisList', headData: [ //{ label: '序号', name: 'ALTId', width: 200, align: "left" }, - { label: '姓名', name: 'empname', width: 200, align: "left" }, + { label: '姓名', name: 'empname', width: 100, align: "left" }, { - label: '教师职务', name: 'zhiwu', width: 200, align: "left", + label: '教师职务', name: 'zhiwu', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, @@ -90,7 +98,7 @@ var bootstrap = function ($, learun) { } }, { - label: '部门', name: 'dept', width: 200, align: "left", + label: '部门', name: 'dept', width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', @@ -100,7 +108,8 @@ var bootstrap = function ($, learun) { callback(_data['name']); } }); - } }, + } + }, { label: '周任务课时(节)', name: 'weekcourses', width: 200, align: "left" }, { label: '实际月课时量(节)', name: 'monthactcourses', width: 200, align: "left" }, { label: '折算后月课时量(节)', name: 'zhesuan_monthactcourses', width: 200, align: "left" }, @@ -108,14 +117,14 @@ var bootstrap = function ($, learun) { { label: '实发课时费(元)', name: 'actfeestandard', width: 200, align: "left" }, ], mainId: 'ALTId', - isPage: true + isPage: true, + sidx: 'empno' }); - page.search(); }, search: function (param) { param = param || {}; - //param.StartTime = startTime; - //param.EndTime = endTime; + param.StartTime = startTime; + param.EndTime = endTime; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; 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 4a8b20c66..dcea10ee5 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 @@ -1022,6 +1022,8 @@ + + @@ -8350,6 +8352,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs index 50d1e3eaa..ae7e2909f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs @@ -2225,13 +2225,11 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les { var strSql = new StringBuilder(); var queryParam = queryJson.ToJObject(); - int month = queryParam["month"] == null ? DateTime.Now.Month : queryParam["month"].ToInt(); - if (month < 1 || month > 12) month = DateTime.Now.Month; int weeks = queryParam["weeks"] == null ? 4 : queryParam["weeks"].ToInt(); if (weeks < 1 || weeks > 4) weeks = 4; var deptNo = queryParam["deptNo"] == null ? string.Empty : queryParam["deptNo"].ToString(); - string starttime = DateTime.Now.Year.ToString() + "-" + month + "-1 00:00:00"; - string endtime = DateTime.Now.Year.ToString() + "-" + month + "-" + DateTime.DaysInMonth(DateTime.Now.Year, month) + " 23:59:59"; + string starttime = queryParam["StartTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["StartTime"].ToString(); + string endtime = queryParam["EndTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["EndTime"].ToString(); strSql.Append("select a.*,b.jobrank as zhiwu,b.F_DepartmentId as dept,b.feestandard,b.Weekcourses,ta.actcourses as monthactcourses,ta.actcourses-(" + weeks + "*b.Weekcourses) as zhesuan_monthactcourses, "); strSql.Append(" case when b.jobrank in(5,6) then (ta.actcourses-" + weeks + "*b.Weekcourses)*b.feestandard "); strSql.Append(" when b.jobrank in(1,2,3,4) then (case when ta.actcourses<=(" + weeks + "*b.weekcourses)/2 then ta.actcourses*b.feestandard else " + weeks + "*b.weekcourses*b.feestandard/2 end) "); @@ -2250,17 +2248,6 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les strSql.Append("where a.empno is not null "); return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); - //todo:获取当前时间所在月的周数,待使用??? - DateTime date = new DateTime(2021, 9, 3); // 设置为想要查询的日期 - - int firstDayOfWeekIndex = (int)date.Date.DayOfWeek; // 获取当前日期对应的星期索引(从0开始) - int daysInMonth = DateTime.DaysInMonth(date.Year, date.Month); // 获取指定月份的天数 - - int weeksCount = Math.DivRem(daysInMonth + firstDayOfWeekIndex - 1, 7, out int remainingDays); // 计算总共的周数及剩余的天数 - - if (remainingDays > 0 && firstDayOfWeekIndex != 6) // 若最后一周不完整或者起始日为星期六则加上一周 - weeksCount++; - } catch (Exception ex) {