@@ -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(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult StatisticsTeach() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -109,6 +121,27 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetStatisticsTeach(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
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 提交数据 | |||
@@ -7,9 +7,9 @@ | |||
<div class="lr-form-item-title">学生姓名</div> | |||
<input id="StuNo" type="text" readonly class="form-control currentInfo lr-currentInfo-user" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="HealthPunchStu" > | |||
<div class="col-xs-6 lr-form-item" data-table="HealthPunchStu"> | |||
<div class="lr-form-item-title">体温上报<font face="宋体">*</font></div> | |||
<input id="Temperature" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | |||
<input id="Temperature" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="HealthPunchStu" > | |||
<div class="lr-form-item-title">打卡所在地址<font face="宋体">*</font></div> | |||
@@ -42,8 +42,19 @@ var bootstrap = function ($, learun) { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
var Num = $('#Temperature').val(); | |||
if (Num < 23 || Num > 44) { | |||
var NumOne = Num.split('.'); | |||
if (NumOne.length != 2) { | |||
learun.alert.warning("请填写正确的体温!例如 : 36.0或37.5"); | |||
return false; | |||
} | |||
if (Num < 33 || Num > 44) { | |||
learun.alert.warning("请填写正确的体温!"); | |||
return false; | |||
} | |||
Num = Num.substring(2); | |||
if (Num.length != 2) { | |||
learun.alert.warning("请填写正确的体温!例如 : 36.0或37.5"); | |||
return false; | |||
} | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchStu/PunchCard?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
@@ -19,9 +19,8 @@ var bootstrap = function ($, learun) { | |||
$('#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') } } | |||
{ 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, | |||
@@ -35,7 +34,7 @@ var bootstrap = function ($, learun) { | |||
preyShow: false, | |||
yShow: false, | |||
// 默认 | |||
dfvalue: '1', | |||
dfvalue: '0', | |||
selectfn: function (begin, end) { | |||
startTime = begin; | |||
endTime = end; | |||
@@ -47,7 +46,7 @@ var bootstrap = function ($, learun) { | |||
}, 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" }], | |||
data: [{ text: "未打卡", value: "0" }, { text: "缺卡", value: "1" }, { text: "已打卡", value: "2" }], | |||
text: "text", | |||
value: "value" | |||
}) | |||
@@ -148,9 +147,9 @@ var bootstrap = function ($, learun) { | |||
label: "打卡状态", name: "Num", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
if (cellvalue == 0) { | |||
return '<span class=\"label label-danger\">缺卡</span>'; | |||
return '<span class=\"label label-danger\">未打卡</span>'; | |||
} else if (cellvalue < "3") { | |||
return '<span class=\"label label-warning\">未打卡</span>'; | |||
return '<span class=\"label label-warning\">缺卡</span>'; | |||
} else if (cellvalue == "3") { | |||
return "<span class=\"label label-success\">已打卡</span>"; | |||
} | |||
@@ -159,7 +158,7 @@ var bootstrap = function ($, learun) { | |||
], | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: 'MajorNo asc,ClassNo asc', | |||
sidx: 'DKDate desc,MajorNo asc,ClassNo asc', | |||
}); | |||
page.search(); | |||
@@ -0,0 +1,42 @@ | |||
@{ | |||
ViewBag.Title = "健康打卡时段"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学工号</div> | |||
<input id="StuNo" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">姓名</div> | |||
<input id="StuName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">打卡状态</div> | |||
<div id="IsStatus"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/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 '<span class=\"label label-danger\">未打卡</span>'; | |||
} else if (cellvalue < "3") { | |||
return '<span class=\"label label-warning\">缺卡</span>'; | |||
} else if (cellvalue == "3") { | |||
return "<span class=\"label label-success\">已打卡</span>"; | |||
} | |||
} | |||
}, | |||
], | |||
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(); | |||
} |
@@ -15,7 +15,7 @@ | |||
<div class="lr-form-item-title">描述<font face="宋体">*</font></div> | |||
<div id="Description" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="HealthPunchTime" > | |||
<div class="col-xs-6 lr-form-item" data-table="HealthPunchTime" style="display: none; "> | |||
<div class="lr-form-item-title">是否启用<font face="宋体">*</font></div> | |||
<div id="CheckMark" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
@@ -17,7 +17,7 @@ var bootstrap = function ($, learun) { | |||
bind: function () { | |||
$('#Description').lrDataItemSelect({ code: 'HealthPunchType' }); | |||
$('#CheckMark').lrDataItemSelect({ code: 'YesOrNoInt' }); | |||
$('#CheckMark').lrselectSet("1"); | |||
$('#CheckMark').lrselectSet("0"); | |||
$('#CreateUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; | |||
$('#CreateUser').val(learun.clientdata.get(['userinfo']).realName); | |||
$('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); | |||
@@ -1028,6 +1028,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\FormIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\FormPeople.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\FillinFrom\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\StatisticsTeach.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\Statistics.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\JournalSend\FormOfDC.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\JournalSend\IndexOfDC.js" /> | |||
@@ -7864,6 +7865,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElective\IndexElective.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElective\FormOfElective.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\Statistics.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\HealthPunchStu\StatisticsTeach.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -439,7 +439,7 @@ where l.EPLId='{EPLId}'"; | |||
from Exam_ExamPlanRoom a | |||
join Exam_ExamPlanLesson b on a.EPLId = b.EPLId | |||
where b.EPId = '{EPId}'"); | |||
db.BeginTrans(); | |||
//老师时间管理 | |||
var examTeacherTime = db.FindList<Exam_ExamTeacherTimeEntity>(); | |||
@@ -454,9 +454,15 @@ where l.EPLId='{EPLId}'"; | |||
foreach (var epLesson in examLessonList) | |||
{ | |||
List<string> empnos = new List<string>(); | |||
var LessonNo = epLesson.LessonNo; | |||
if (LessonNo.Contains("(")) | |||
{ | |||
LessonNo = LessonNo.Split('(')[0]; | |||
} | |||
//查询课程信息 | |||
var lessoninfo = db.FindList<LessonInfoEntity>($@"select top 1 t.LessonTypeName,l.* from lessoninfo l | |||
join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{epLesson.LessonNo}' ").FirstOrDefault(); | |||
join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); | |||
if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")) | |||
{ | |||
//如果是专业课,监考老师不能添加这门课的代课老师 | |||
@@ -62,28 +62,87 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
//排考安排课程表Id | |||
var ELEntity = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanEntity>($@"select * from Exam_ExamPlan where EPId=( | |||
select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); | |||
//考试课程数据 | |||
var EPLEntity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanLessonEntity>(queryParam["EPLId"].ToString()); | |||
//排考安排课程表 获取学年学期 | |||
var ELEntity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(EPLEntity.EPId); | |||
if (ELEntity != null) | |||
{ | |||
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); | |||
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); | |||
} | |||
var empSql = $@"SELECT DISTINCT EPLId, STUFF( (SELECT ',' + empno FROM Exam_ExamPlanRoom WHERE EPLId = T.EPLId FOR XML PATH('') ), 1, 1, '') AS empno FROM Exam_ExamPlanRoom AS T | |||
where EPLId ='{queryParam["EPLId"].ToString()}'"; | |||
//同一考试课程下考场的监考老师不重复 | |||
var empSql = "SELECT DISTINCT EPLId, STUFF( (SELECT ',' + empno FROM Exam_ExamPlanRoom WHERE 1=1 "; | |||
if (!queryParam["EPRId"].IsEmpty()) | |||
{ | |||
empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'"; | |||
empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'"; | |||
} | |||
empSql += $@" and EPLId = T.EPLId FOR XML PATH('') ), 1, 1, '') AS empno FROM Exam_ExamPlanRoom AS T | |||
where EPLId ='{queryParam["EPLId"].ToString()}'"; | |||
var obj = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(empSql).Select(x => x.EmpNo).Distinct().ToList(); | |||
if (obj != null && obj.Count > 0) | |||
{ | |||
var empNo = string.Join("','", obj[0].ToString().Split(',').Distinct()); | |||
strSql.Append($" AND t.EmpNo not in ('{empNo}')"); | |||
} | |||
//筛选掉考试时间冲突的老师和专业课的代课老师 | |||
List<string> empnos = new List<string>(); | |||
var LessonNo = EPLEntity.LessonNo; | |||
if (LessonNo.Contains("(")) | |||
{ | |||
LessonNo = LessonNo.Split('(')[0]; | |||
} | |||
//查询课程信息 | |||
var lessoninfo = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>($@"select top 1 t.LessonTypeName,l.* from lessoninfo l | |||
join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); | |||
if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")) | |||
{ | |||
//如果是专业课,监考老师不能添加这门课的代课老师 | |||
var teachClass = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>( | |||
$"select distinct EmpNo from TeachClass where AcademicYearNo='{ELEntity.AcademicYearNo}' and Semester='{ELEntity.Semester}' and lessonno='{LessonNo}'"); | |||
var empno = teachClass.Select(x => x.EmpNo).ToList(); | |||
empnos = empnos.Union(empno).ToList(); | |||
} | |||
if (EPLEntity.ExamDate != null && EPLEntity.ExamTime.Contains("-")) | |||
{ | |||
//当前考试课程考试时间 | |||
var examtimeStart = Convert.ToDateTime(EPLEntity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + (EPLEntity.ExamTime).Split('-')[0]); | |||
var examtimeEnd = Convert.ToDateTime(EPLEntity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + EPLEntity.ExamTime.Split('-')[1]); | |||
//查询这个时间段不能监考的老师 | |||
var empnoTime = this.BaseRepository("CollegeMIS").FindList<Exam_ExamTeacherTimeEntity>(x => | |||
(examtimeStart >= x.ExamTimeStart && examtimeStart <= x.ExamTimeEnd) || (examtimeEnd >= x.ExamTimeStart && examtimeEnd <= x.ExamTimeEnd)).Select(x => x.EmpNo).ToList(); | |||
foreach (var empno in empnoTime) | |||
{ | |||
empnos = empnos.Union(empno.Split(',').ToList()).ToList(); | |||
} | |||
//查询已安排的监考老师数据 | |||
var examRoomByDateSql = $@"select a.EmpNo,b.ExamDate,b.ExamTime from [dbo].[Exam_ExamPlanRoom] a | |||
join Exam_ExamPlanLesson b on a.EPLId = b.EPLId | |||
where a.EmpNo is not null and b.ExamDate='{EPLEntity.ExamDate}' and a.EPLId<>'{queryParam["EPLId"].ToString()}'"; | |||
var examRoomsByDateList = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(examRoomByDateSql).ToList(); | |||
foreach (var examRoom in examRoomsByDateList) | |||
{ | |||
var examRoomTime1 = Convert.ToDateTime(examRoom.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examRoom.ExamTime.Split('-')[0]); | |||
var examRoomTime2 = Convert.ToDateTime(examRoom.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examRoom.ExamTime.Split('-')[1]); | |||
//此处判断当前考场时间是否在考试课程排考时间的开始前30分钟到结束后30分钟 | |||
if ((examRoomTime1 >= examtimeStart.AddMinutes(-30) && examRoomTime1 <= examtimeEnd.AddMinutes(30)) || (examRoomTime2 >= examtimeStart.AddMinutes(-30) && examRoomTime2 <= examtimeEnd.AddMinutes(30))) | |||
{ | |||
empnos.Add(examRoom.EmpNo); | |||
} | |||
} | |||
if (empnos.Count() > 0) | |||
{ | |||
string nos = string.Join("','", empnos); | |||
strSql.Append($" AND t.EmpNo not in ('{nos}')"); | |||
} | |||
} | |||
} | |||
if (!queryParam["SqlParameter"].IsEmpty()) | |||
{ | |||
@@ -111,7 +170,7 @@ select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString( | |||
/// <param name="Semester"></param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_InvigilateTeacherEntity> GetList(string AcademicYearNo, int? Semester) | |||
{ | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_InvigilateTeacherEntity>(x => x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); | |||
@@ -91,6 +91,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 统计数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<HealthPunchStuEntity> 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 提交数据 | |||
@@ -156,6 +156,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[NotMapped] | |||
public string Num { get; set; } | |||
#endregion | |||
public class StuList | |||
{ | |||
public string StuName { get; set; } | |||
public string StuNo { get; set; } | |||
} | |||
} | |||
} | |||
@@ -34,6 +34,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<HealthPunchStuEntity> GetStatistics(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 教师统计数据 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<HealthPunchStuEntity> GetStatisticsTeach(Pagination pagination, string queryJson); | |||
#endregion | |||
#region 提交数据 | |||
@@ -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 | |||
@@ -90,7 +91,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
string sql1 = " "; | |||
string sql2 = " "; | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
sql1 = " and DkDate >= '" + queryParam["StartTime"].ToDate() | |||
@@ -98,41 +99,171 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
if (!queryParam["F_School"].IsEmpty()) | |||
{ | |||
sql1 = " and F_School ='" + queryParam["F_School"].ToString() + "' "; | |||
sql2 = " and F_School ='" + queryParam["F_School"].ToString() + "' "; | |||
} | |||
if (!queryParam["MajorNo"].IsEmpty()) | |||
{ | |||
sql1 += " and MajorNo ='" + queryParam["MajorNo"].ToString() + "'"; | |||
sql2 += " and MajorNo ='" + queryParam["MajorNo"].ToString() + "'"; | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
sql1 += " and ClassNo ='" + queryParam["ClassNo"].ToString() + "'"; | |||
sql2 += " and ClassNo ='" + queryParam["ClassNo"].ToString() + "'"; | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
sql1 += " and StuNo like '%" + queryParam["StuNo"].ToString() + "%'"; | |||
sql2 += " and StuNo like '%" + queryParam["StuNo"].ToString() + "%'"; | |||
} | |||
if (!queryParam["StuName"].IsEmpty()) | |||
{ | |||
sql1 += " and StuName like '%" + queryParam["StuName"].ToString() + "%'"; | |||
sql2 += " and StuName like '%" + queryParam["StuName"].ToString() + "%'"; | |||
} | |||
if (!queryParam["IsStatus"].IsEmpty()) | |||
{ | |||
sql1 = " and t.num = '" + queryParam["IsStatus"].ToString() + "' "; | |||
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<HealthPunchStuEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
strSql.Append(@" select t.* 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 group by StuNo,StuName,DkDate) hps | |||
left join (select * from HealthPunchStu ) AA on AA.StuNo=hps.StuNo and AA.StuName=hps.StuName and AA.dkType=1 | |||
left join (select * from HealthPunchStu ) BB on BB.StuNo=hps.Stuno and BB.StuName=hps.StuName and BB.dkType=2 | |||
left join (select * from HealthPunchStu ) 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 group by Stuno ) dd on dd.StuNo=hps.Stuno | |||
) fb on fb.Stuno = zb.stuno and fb.StuName = zb.StuName --where fb.num >= '1' | |||
)t where 1=1 " + sql1 + " "); | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<HealthPunchStuEntity> GetStatisticsTeach(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var account = LoginUserInfo.Get().account; | |||
var classinfo = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(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<HealthPunchStuEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||