From dd703a2dcf0816142ac18b9c897104ec9528b21c Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Wed, 9 Dec 2020 17:16:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91PC=E7=AB=AF?= =?UTF-8?q?=EF=BC=8C=E7=A7=BB=E5=8A=A8=E7=AB=AF=EF=BC=8C=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E8=87=AA=E8=AF=8A=E6=89=93=E5=8D=A1=E6=B5=8B=E6=B8=A9=EF=BC=9A?= =?UTF-8?q?=E7=94=B1=E5=9B=BA=E5=AE=9A=E7=9A=84=E6=B5=8B=E6=B8=A9=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E8=B0=83=E6=95=B4=E4=B8=BA=E6=97=A0=E9=99=90=E6=AC=A1?= =?UTF-8?q?=E6=B5=8B=E6=B8=A9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Thermography/Thermography.js | 2 +- .../Thermography/measure/measure.js | 5 +- .../Views/Thermography/Index.js | 2 +- .../Views/Thermography/SubmitIndex.cshtml | 5 +- .../Views/Thermography/SubmitIndex.js | 13 +++++ .../Thermography/ThermographyService.cs | 48 +++++++++++++------ 6 files changed, 54 insertions(+), 21 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/Thermography.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/Thermography.js index 754315bea..fef143a77 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/Thermography.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/Thermography.js @@ -84,7 +84,7 @@ pagination: { rows: param.rows, page: param.page, - sidx: 'MeasureDate', + sidx: 'MeasureDate desc,PersonBeingMeasured', sord: 'DESC' }, queryJson: JSON.stringify({ MeasurerID: learun.storage.get('userinfo').baseinfo.account }) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.js index 559104786..425fa2e07 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.js @@ -11,15 +11,16 @@ change: function (value, text, datalist, $self) { loadData($page, param); } - }).lrpickerSet(0); + }).lrpickerSet(-1); //状态 $page.find('#Status').lrpickerex({ code: 'TemperatureMeasure', type: 'dataItem' }).lrpickerSet(1); //初始化 - setTimeout(function () { + var timer = setTimeout(function () { loadData($page, param); + clearTimeout(timer); }, 1000); //选择学生 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/Index.js index 3c374b2c2..291765b6f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/Index.js @@ -260,7 +260,7 @@ var bootstrap = function ($, learun) { ], mainId: 'ID', isPage: true, - sidx: 'MeasureDate', + sidx: 'MeasureDate desc,PersonBeingMeasured', sord: 'desc' }); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.cshtml index 2c59a50da..c543232f1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.cshtml @@ -14,9 +14,10 @@
-  提交上午测温 + @* 提交上午测温  提交中午测温 -  提交晚上测温 +  提交晚上测温*@ +  提交测温
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.js index ebb135529..4cabe281f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Thermography/SubmitIndex.js @@ -69,6 +69,19 @@ var bootstrap = function ($, learun) { } }); + //提交测温 + $('#lr_submit').on('click', function () { + var datas = $('#gridtable').jfGridGet('rowdatas'); + if (datas.length > 0) { + learun.layerConfirm('是否确认提交测温!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '-1', rowdatas: JSON.stringify(datas) }, function () { + refreshGirdData(); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Thermography/ThermographyService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Thermography/ThermographyService.cs index 4c58663af..3e1da4e07 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Thermography/ThermographyService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Thermography/ThermographyService.cs @@ -225,7 +225,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var userInfo = LoginUserInfo.Get(); var strSql = new StringBuilder(); - strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,'0' as Status,c.ClassName "); + strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,'1' as Status,c.ClassName "); strSql.Append(" FROM StuInfoBasic t left join StuInfoBasic tt on t.ClassNo=tt.ClassNo left join ClassInfo c on t.ClassNo=c.ClassNo "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); @@ -269,16 +269,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var dp = new DynamicParameters(new { }); var nowDate = DateTime.Now.Date; var nextDate = DateTime.Now.AddDays(1).Date; - strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,c.ClassName "); - strSql.Append(" ,g.ID,case when g.Status is null then '0' else g.Status end as Status,g.Temperature,g.ProcessingResult,g.Remark,g.MeasureTime "); + strSql.Append("SELECT t.ClassNo,t.DeptNo,t.MajorNo,t.StuNo as PersonBeingMeasured,t.StuName as PersonBeingMeasuredName,'" + userInfo.account + "' as MeasurerID,'1' as Status,c.ClassName "); + if (!queryParam["MeasureTime"].IsEmpty() && queryParam["MeasureTime"].ToString() != "-1") + { + strSql.Append(" ,g.ID,case when g.Status is null then '1' else g.Status end as Status,g.Temperature,g.ProcessingResult,g.Remark,g.MeasureTime "); + } strSql.Append(" FROM StuInfoBasic t left join StuInfoBasic tt on t.ClassNo=tt.ClassNo left join ClassInfo c on t.ClassNo=c.ClassNo "); - strSql.Append(" left join Thermography g on t.StuNo=g.PersonBeingMeasured and t.ClassNo=g.ClassNo and t.DeptNo=g.DeptNo and t.MajorNo=g.DeptNo "); - strSql.Append(" and g.MeasureDate >='" + nowDate + "' and g.MeasureDate<'" + nextDate + "' "); - if (!queryParam["MeasureTime"].IsEmpty()) + if (!queryParam["MeasureTime"].IsEmpty() && queryParam["MeasureTime"].ToString() != "-1") { + strSql.Append(" left join Thermography g on t.StuNo=g.PersonBeingMeasured and t.ClassNo=g.ClassNo and t.DeptNo=g.DeptNo and t.MajorNo=g.DeptNo "); + strSql.Append(" and g.MeasureDate >='" + nowDate + "' and g.MeasureDate<'" + nextDate + "' "); + dp.Add("MeasureTime", queryParam["MeasureTime"].ToString(), DbType.String); strSql.Append(" and g.MeasureTime=@MeasureTime "); } + strSql.Append(" WHERE 1=1 "); if (!queryParam["MeasurerID"].IsEmpty()) { @@ -390,16 +395,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - if (!string.IsNullOrEmpty(keyValue)) + //限制测温时间(上午、中午、晚上)时:判断学生是否已测温,是则更新,否则新增;不限制测温时间时:新增; + if (entity.MeasureTime == "-1") { - entity.Modify(keyValue, userInfo); - this.BaseRepository("CollegeMIS").Update(entity); + entity.Create(userInfo); + this.BaseRepository("CollegeMIS").Insert(entity); } else { - entity.Create(userInfo); - this.BaseRepository("CollegeMIS").Insert(entity); + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue, userInfo); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(userInfo); + this.BaseRepository("CollegeMIS").Insert(entity); + } } + LogEntity logEntity = new LogEntity(); logEntity.F_LogId = Guid.NewGuid().ToString(); logEntity.F_Module = "Thermography"; @@ -527,11 +542,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration entity.MeasureDate = now; entity.MeasureTime = measureTime; entity.CreateTime = now; - //判断学生是否已测温 - var model = db.FindEntity(x => x.PersonBeingMeasured == entity.PersonBeingMeasured && x.MeasureTime == measureTime && x.MeasureDate >= nowDate && x.MeasureDate < nextDate); - if (model != null) + //限制测温时间(上午、中午、晚上)时:判断学生是否已测温,是则更新,否则新增;不限制测温时间时:新增; + if (measureTime != "-1") { - db.Delete(model); + var model = db.FindEntity(x => x.PersonBeingMeasured == entity.PersonBeingMeasured && x.MeasureTime == measureTime && x.MeasureDate >= nowDate && x.MeasureDate < nextDate); + if (model != null) + { + db.Delete(model); + } } entity.Create(userInfo); db.Insert(entity);