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);