From f8fbdb744aab969d46cf60aa6ae4768c5eba65fe Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 21 Jun 2022 15:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=8F=AD=E4=B8=BB=E4=BB=BB?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E4=BD=93=E6=B8=A9=E4=B8=8A=E6=8A=A5=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HealthPunchStuController.cs | 33 ++++ .../HealthPunchStu/StatisticsTeach.cshtml | 42 +++++ .../Views/HealthPunchStu/StatisticsTeach.js | 147 ++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../HealthPunchStu/HealthPunchStuBLL.cs | 24 +++ .../HealthPunchStu/HealthPunchStuIBLL.cs | 7 + .../HealthPunchStu/HealthPunchStuService.cs | 112 +++++++++++++ 7 files changed, 367 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchStuController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchStuController.cs index 28bfe2bd0..bf05441db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchStuController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchStuController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,6 +17,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class HealthPunchStuController : MvcControllerBase { private HealthPunchStuIBLL healthPunchStuIBLL = new HealthPunchStuBLL(); + private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); #region 视图功能 @@ -46,6 +48,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 表单页 + /// + /// + /// + [HttpGet] + public ActionResult StatisticsTeach() + { + return View(); + } #endregion #region 获取数据 @@ -109,6 +121,27 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStatisticsTeach(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = healthPunchStuIBLL.GetStatisticsTeach(paginationobj, queryJson); + var jsonData = new + { + rows = data, + 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/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.cshtml new file mode 100644 index 000000000..07768b4c1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "健康打卡时段"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
学工号
+ +
+
+
姓名
+ +
+
+
打卡状态
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.js new file mode 100644 index 000000000..3038e1d0b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/StatisticsTeach.js @@ -0,0 +1,147 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-06-17 09:17 + * 描 述:健康打卡时段 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + 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: '昨天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59', 'd', -1) } }, + { name: '前天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -2) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59', 'd', -2) } } + ], + // 月 + 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; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#IsStatus').lrselect({ + data: [{ text: "未打卡", value: "0" }, { text: "缺卡", value: "1" }, { text: "已打卡", value: "2" }], + text: "text", + value: "value" + }) + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/GetStatisticsTeach', + headData: [ + { + label: "院校", name: "F_School", width: 130, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 130, 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: 90, 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: "StuNo", width: 90, align: "left" }, + { label: "学生姓名", name: "StuName", width: 150, align: "left" }, + { label: "联系方式", name: "Phone", width: 100, align: "left" }, + { + label: "日期", name: "DKDate", width: 90, align: "left", + formatter: function (cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd'); + } + }, + { label: "早打卡地址", name: "Address1", width: 200, align: "left" }, + { label: "午打卡地址", name: "Address2", width: 200, align: "left" }, + { label: "晚打卡地址", name: "Address3", width: 200, align: "left" }, + { label: "早体温", name: "Temperature1", width: 80, align: "left" }, + { label: "午体温", name: "Temperature2", width: 80, align: "left" }, + { label: "晚体温", name: "Temperature3", width: 80, align: "left" }, + { + label: "打卡状态", name: "Num", width: 100, align: "left", + formatter: function (cellvalue) { + if (cellvalue == 0) { + return '未打卡'; + } else if (cellvalue < "3") { + return '缺卡'; + } else if (cellvalue == "3") { + return "已打卡"; + } + } + }, + ], + mainId: 'ID', + isPage: true, + sidx: 'DKDate desc,MajorNo asc,ClassNo asc', + + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + $('#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 c0ffaf7b2..dce78cdaf 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 @@ -1028,6 +1028,7 @@ + @@ -7864,6 +7865,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuBLL.cs index 5735857ab..4322a295a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuBLL.cs @@ -91,6 +91,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 统计数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetStatisticsTeach(Pagination pagination, string queryJson) + { + try + { + return healthPunchStuService.GetStatisticsTeach(pagination, queryJson); + } + 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/HealthPunchStu/HealthPunchStuIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuIBLL.cs index e8eeb7614..c4c326796 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuIBLL.cs @@ -34,6 +34,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// IEnumerable GetStatistics(Pagination pagination, string queryJson); + /// + /// 教师统计数据 + /// + /// + /// + /// + IEnumerable GetStatisticsTeach(Pagination pagination, string queryJson); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuService.cs index a0483f3d1..22b6a674e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -166,6 +167,117 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetStatisticsTeach(Pagination pagination, string queryJson) + { + try + { + var account = LoginUserInfo.Get().account; + var classinfo = this.BaseRepository("CollegeMIS").FindList(x => x.ClassDiredctorNo == account).ToList(); + var strSql = new StringBuilder(); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + string sql1 = " "; + string sql2 = " "; + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + sql1 = " and DkDate >= '" + queryParam["StartTime"].ToDate() + + "' and DkDate <= '" + queryParam["EndTime"].ToDate() + "' "; + } + if (classinfo.Count > 0) + { + var classno = classinfo.FirstOrDefault(); + if (classinfo.Count == 1) + { + sql2 += " and ClassNo ='" + classno.ClassNo + "'"; + } + else + { + sql2 += " and ("; + for (int i = 0; i < classinfo.Count; i++) + { + if (i == 0) + { + sql2 += " classno ='" + classinfo[i].ClassNo + "' "; + } + else + { + sql2 += " or classno ='" + classinfo[i].ClassNo + "' "; + } + } + sql2 += ")"; + } + } + else + { + sql2 += " and t.num = '-1' "; + } + if (!queryParam["ClassNo"].IsEmpty()) + { + sql2 += " and ClassNo ='" + queryParam["ClassNo"].ToString() + "'"; + } + if (!queryParam["StuNo"].IsEmpty()) + { + sql2 += " and StuNo like '%" + queryParam["StuNo"].ToString() + "%'"; + } + if (!queryParam["StuName"].IsEmpty()) + { + sql2 += " and StuName like '%" + queryParam["StuName"].ToString() + "%'"; + } + if (!queryParam["IsStatus"].IsEmpty()) + { + string Num = queryParam["IsStatus"].ToString(); + if (Num == "0") + { + sql2 += " and t.num = '" + Num + "' "; + } + else if (Num == "1") + { + sql2 += " and t.num < '3' and t.num <> '0' "; + } + else if (Num == "2") + { + sql2 += " and t.num = '3' "; + } + } + + strSql.Append(@" select * from ( + select zb.F_SchoolId as F_School,zb.MajorNo,zb.ClassNo,zb.StuNo,zb.StuName,zb.mobile,isnull(fb.DkDate,Getdate()) as DkDate, + fb.Address1,fb.Address2,fb.Address3,fb.Temperature1,fb.Temperature2,fb.Temperature3,isnull(fb.Num,0) as Num from StuInfoBasic zb + left join ( + select hps.*,aa.address as Address1,aa.Temperature as Temperature1 ,bb.address as Address2,bb.Temperature as Temperature2,cc.address as Address3 ,cc.Temperature + as Temperature3,dd.Num from ( + select StuNo,StuName,DkDate from HealthPunchStu hps where 1=1 " + sql1 + ""); + strSql.Append(@" group by StuNo,StuName,DkDate) hps + left join (select * from HealthPunchStu where 1=1 " + sql1 + ""); + strSql.Append(@" ) AA on AA.StuNo=hps.StuNo and AA.StuName=hps.StuName and AA.dkType=1 + left join (select * from HealthPunchStu where 1=1 " + sql1 + ""); + strSql.Append(@" ) BB on BB.StuNo=hps.Stuno and BB.StuName=hps.StuName and BB.dkType=2 + left join (select * from HealthPunchStu where 1=1 " + sql1 + ""); + strSql.Append(@" ) CC on CC.StuNo=hps.Stuno and CC.StuName=hps.StuName and CC.dkType=3 + left join (select Stuno,Count(*) as num from HealthPunchStu hps where 1=1 " + sql1 + " "); + strSql.Append(@" group by Stuno ) dd on dd.StuNo=hps.Stuno + ) fb on fb.Stuno = zb.stuno and fb.StuName = zb.StuName + )t where 1= 1 " + sql1 + sql2 + " "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据