diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentBLL.cs index 9f2fffe98..5359fda69 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentBLL.cs @@ -432,6 +432,30 @@ namespace Learun.Application.Organization } } } + /// + /// 保存部门信息(新增、修改) + /// + /// 主键值 + /// 部门实体 + /// + public void SaveEntity2(string keyValue, DepartmentEntity departmentEntity) + { + try + { + departmentService.SaveEntity(keyValue, departmentEntity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } public List GetAllList() { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentEntity.cs index 5aba87495..8e1956d76 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentEntity.cs @@ -172,6 +172,11 @@ namespace Learun.Application.Organization /// [Column("F_ORDER")] public int? F_Order { get; set; } + /// + /// 发送标识(对接第三方人脸系统) + /// + [Column("SENDFLAG")] + public bool? SendFlag { get; set; } #endregion #region 扩展操作 @@ -200,8 +205,8 @@ namespace Learun.Application.Organization this.F_ModifyDate = DateTime.Now; UserInfo userInfo = LoginUserInfo.Get(); - this.F_ModifyUserId = userInfo.userId; - this.F_ModifyUserName = userInfo.realName; + this.F_ModifyUserId = userInfo?.userId; + this.F_ModifyUserName = userInfo?.realName; } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentIBLL.cs index 16cff28d9..7d3e8836c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Department/DepartmentIBLL.cs @@ -89,6 +89,13 @@ namespace Learun.Application.Organization /// 部门实体 /// void SaveEntity(string keyValue, DepartmentEntity departmentEntity); + /// + /// 保存部门信息(新增、修改) + /// + /// 主键值 + /// 部门实体 + /// + void SaveEntity2(string keyValue, DepartmentEntity departmentEntity); #endregion List GetAllList(); 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 010684899..28bfe2bd0 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 @@ -37,6 +37,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Statistics() + { + return View(); + } #endregion #region 获取数据 @@ -78,6 +87,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStatistics(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = healthPunchStuIBLL.GetStatistics(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/Statistics.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/Statistics.cshtml new file mode 100644 index 000000000..913cf6fd0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/Statistics.cshtml @@ -0,0 +1,61 @@ +@{ + ViewBag.Title = "健康打卡时段"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
院校
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
学工号
+ +
+
+
姓名
+ +
+
+
打卡状态
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchStu/Statistics.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/Statistics.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/Statistics.js new file mode 100644 index 000000000..cb0c4e838 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchStu/Statistics.js @@ -0,0 +1,178 @@ +/* * 版 本 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: '近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); + $('#F_School').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#IsStatus').lrselect({ + data: [{ text: "已打卡", value: "0" }, { text: "缺卡", value: "1" }, { text: "未打卡", value: "2" }], + text: "text", + value: "value" + }) + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + value: "majorno", + text: "majorname", + param: { strWhere: "1=1 AND CheckMark=1 order by majorno asc" }, + select: function (item) { + if (item) { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno asc" } + }); + } else { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1 order by classno asc" } + }); + } + } + }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" }, + value: "classno", + text: "classname" + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/GetStatistics', + 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: 'createtime desc', + + }); + 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/Areas/LR_OrganizationModule/Controllers/DepartmentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/DepartmentController.cs index f81b9b7c9..869c9f0c6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/DepartmentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/DepartmentController.cs @@ -150,6 +150,8 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers return Fail("部门编号已存在!"); } } + //发送标识false + entity.SendFlag = false; departmentIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } 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 148722cb5..c0ffaf7b2 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 @@ + @@ -7862,6 +7863,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TransferApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TransferApi.cs index 5644082bf..c05bc3d76 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TransferApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TransferApi.cs @@ -27,7 +27,7 @@ namespace Learun.Application.WebApi { private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); - private CdDeptIBLL cdDeptIBLL = new CdDeptBLL(); + private DepartmentIBLL departmentIBLL = new DepartmentBLL(); private UserIBLL userIBLL = new UserBLL(); /// @@ -37,7 +37,7 @@ namespace Learun.Application.WebApi : base("/TransferApi/BasicInfo") { //发送部门基础信息 - Get["/sendDeptInfo"] = SendDeptInfo; + Get["/sendDepartmentInfo"] = SendDepartmentInfo; //发送教师基础信息 Get["/sendTeacherInfo"] = SendTeacherInfo; //发送学生基础信息 @@ -79,7 +79,7 @@ namespace Learun.Application.WebApi /// /// /// - public Response SendDeptInfo(dynamic _) + public Response SendDepartmentInfo(dynamic _) { var result = new List(); @@ -88,26 +88,32 @@ namespace Learun.Application.WebApi //调登录接口拿到cookie GetCookie(); } - var deptList = cdDeptIBLL.GetAllList(); - foreach (var item in deptList) + var departmentList = departmentIBLL.GetAllList().Where(x => x.SendFlag == false); + foreach (var item in departmentList) { var param = new { - ParentCode = "iccsid", + ParentCode = string.IsNullOrEmpty(item.F_ParentId) || item.F_ParentId == "0" ? "iccsid" : (departmentIBLL.GetEntity(item.F_ParentId) == null ? "iccsid" : departmentIBLL.GetEntity(item.F_ParentId)?.F_EnCode), pageSize = 10, - Name = "部门5", - Code = "5", + Name = item.F_FullName, + Code = item.F_EnCode, }; - + var responseSend = SendRequestWithCookie("POST", "application/json;charset=utf-8", @"http://172.70.0.4:8088/fastgate/department", Encoding.UTF8, JsonConvert.SerializeObject(param)); var responseSendObj = JsonConvert.DeserializeObject(responseSend); - result.Add("部门编号" + item.DeptNo + ",新增接口结果:" + responseSendObj.ErrCode + responseSendObj.ErrMsg); + result.Add("部门编号" + item.F_EnCode + ",新增接口结果:" + responseSendObj.ErrCode + responseSendObj.ErrMsg); if (responseSendObj.ErrCode == 200) { //第三方新增成功,修改表-发送标识为true //TODO: + var entity = departmentIBLL.GetEntity(item.F_DepartmentId); + if (entity != null) + { + entity.SendFlag = true; + departmentIBLL.SaveEntity2(entity.F_DepartmentId, entity); + } } else if (responseSendObj.ErrCode == 1010) //{ "ErrCode":1010,"ErrMsg":"登录状态已失效"} { @@ -119,19 +125,25 @@ namespace Learun.Application.WebApi //调修改接口 var param2 = new { - Code = "5", - Name = "部门bm5", + Code = item.F_EnCode, + Name = item.F_FullName, pageSize = 10, }; var responseSend2 = SendRequestWithCookie("PUT", "application/json;charset=utf-8", @"http://172.70.0.4:8088/fastgate/department", Encoding.UTF8, JsonConvert.SerializeObject(param2)); var responseSendObj2 = JsonConvert.DeserializeObject(responseSend2); - result.Add("部门编号" + item.DeptNo + ",修改接口结果:" + responseSendObj2.ErrCode + responseSendObj2.ErrMsg); + result.Add("部门编号" + item.F_EnCode + ",修改接口结果:" + responseSendObj2.ErrCode + responseSendObj2.ErrMsg); if (responseSendObj2.ErrCode == 200) { //第三方修改成功,修改表-发送标识为true //TODO: + var entity = departmentIBLL.GetEntity(item.F_DepartmentId); + if (entity != null) + { + entity.SendFlag = true; + departmentIBLL.SaveEntity2(entity.F_DepartmentId, entity); + } } else { @@ -172,7 +184,7 @@ namespace Learun.Application.WebApi var param = BuildQuery2(parameters, "----WebKitFormBoundaryAOT8GpQYYAP9jgGf"); var contentType = "multipart/form-data; boundary=----WebKitFormBoundaryAOT8GpQYYAP9jgGf"; - var responseSend = SendRequestWithCookie("POST",contentType, @"http://172.70.0.4:8088/fastgate/person", Encoding.UTF8, param); + var responseSend = SendRequestWithCookie("POST", contentType, @"http://172.70.0.4:8088/fastgate/person", Encoding.UTF8, param); var responseSendObj = JsonConvert.DeserializeObject(responseSend); result.Add("教师编号,新增接口结果:" + responseSendObj.ErrCode + responseSendObj.ErrMsg); 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 8ea6781e0..5735857ab 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 @@ -67,6 +67,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 统计数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetStatistics(Pagination pagination, string queryJson) + { + try + { + return healthPunchStuService.GetStatistics(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/HealthPunchStuEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuEntity.cs index a73025327..430bf6b2a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchStu/HealthPunchStuEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 日 期:2022-06-17 11:00 /// 描 述:体温上报 /// - public class HealthPunchStuEntity + public class HealthPunchStuEntity { #region 实体成员 /// @@ -139,6 +139,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 + + [NotMapped] + public string Address1 { get; set; } + [NotMapped] + public string Address2 { get; set; } + [NotMapped] + public string Address3 { get; set; } + + [NotMapped] + public string Temperature1 { get; set; } + [NotMapped] + public string Temperature2 { get; set; } + [NotMapped] + public string Temperature3 { get; set; } + [NotMapped] + public string Num { get; set; } #endregion } } 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 8404e7d0b..e8eeb7614 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 @@ -27,6 +27,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// HealthPunchStuEntity GetHealthPunchStuEntity(string keyValue); + /// + /// 统计数据 + /// + /// + /// + /// + IEnumerable GetStatistics(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 5901add0b..b57f8e97a 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 @@ -76,6 +76,86 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetStatistics(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + string sql1 = " "; + string sql2 = " "; + string sql3 = " "; + + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + sql1 = " and Createtime >= '" + queryParam["StartTime"].ToDate() + + "' and Createtime <= '" + queryParam["EndTime"].ToDate() + "' "; + } + if (!queryParam["F_School"].IsEmpty()) + { + sql2 = " and F_School ='" + queryParam["F_School"].ToString() + "' "; + } + if (!queryParam["MajorNo"].IsEmpty()) + { + sql2 += "and MajorNo ='" + queryParam["MajorNo"].ToString() + "'"; + } + 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()) + { + sql3 = " and t.num >= '" + queryParam["IsStatus"].ToString() + "' "; + } + strSql.Append(@"select * from ( + select zb.*,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 F_School,MajorNo,ClassNo,StuNo,StuName,DKDate,Phone from HealthPunchStu + where 1=1 " + sql1 + sql2 + " "); + strSql.Append(@" Group by F_School,MajorNo,ClassNo,StuNo,StuName,DKDate,Phone )zb + left join (select * from HealthPunchStu where 1=1 " + sql1 + " )"); + strSql.Append(@" AA on AA.F_School=zb.F_School and AA.MajorNo=zb.MajorNo + and AA.ClassNo=zb.ClassNo and AA.StuNo=zb.Stuno and AA.StuName=zb.StuName + and AA.Phone=zb.Phone and AA.dkDate=zb.Dkdate and AA.dkType=1 + left join (select * from HealthPunchStu where 1=1 " + sql1 + " )"); + strSql.Append(@" BB on BB.F_School=zb.F_School and BB.MajorNo=zb.MajorNo + and BB.ClassNo=zb.ClassNo and BB.StuNo=zb.Stuno and BB.StuName=zb.StuName + and BB.Phone=zb.Phone and BB.dkDate=zb.Dkdate and BB.dkType=2 + left join (select * from HealthPunchStu where 1=1 " + sql1 + " )"); + strSql.Append(@" CC on CC.F_School=zb.F_School and CC.MajorNo=zb.MajorNo + and CC.ClassNo=zb.ClassNo and CC.StuNo=zb.Stuno and CC.StuName=zb.StuName + and CC.Phone=zb.Phone and CC.dkDate=zb.Dkdate and CC.dkType=3 + left join (select Stuno ,Count(*) as num from HealthPunchStu group by Stuno ) dd on dd.StuNo=zb.Stuno + )t where 1=1 " + sql3 + " "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据