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 1/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91PC?= =?UTF-8?q?=E7=AB=AF=EF=BC=8C=E7=A7=BB=E5=8A=A8=E7=AB=AF=EF=BC=8C=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E8=87=AA=E8=AF=8A=E6=89=93=E5=8D=A1=E6=B5=8B=E6=B8=A9?= =?UTF-8?q?=EF=BC=9A=E7=94=B1=E5=9B=BA=E5=AE=9A=E7=9A=84=E6=B5=8B=E6=B8=A9?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E8=B0=83=E6=95=B4=E4=B8=BA=E6=97=A0=E9=99=90?= =?UTF-8?q?=E6=AC=A1=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班级:
').dataFormatter({ + value: _item.ClassNo, + type: 'dataSource', + code: 'bjsj', + keyId: 'classno', + text: 'classname' + })); + _$item.append($('测温人:
').dataFormatter({ + value: _item.MeasurerID, + type: 'dataSource', + code: 'BaseUser', + keyId: 'f_account', + text: 'f_realname' + })); + _$item.append($('被测温人学号:
').dataFormatter({ + value: _item.PersonBeingMeasured + })); + _$item.append($('被测温人:
').dataFormatter({ + value: _item.PersonBeingMeasured, + type: 'dataSource', + code: 'BaseUser', + keyId: 'f_account', + text: 'f_realname' + })); + _$item.append($('状态:
').dataFormatter({ + value: _item.Status, + type: 'dataItem', + code: 'TemperatureMeasure' + })); + _$item.append($('温度:
').dataFormatter({ value: _item.Temperature })); + _$item.append($('处理结果:
').dataFormatter({ value: _item.ProcessingResult })); + _$item.append($('备注:
').dataFormatter({ value: _item.Remark })); + _$item.append($('测量时间:
').dataFormatter({ + value: _item.MeasureDate, + type: 'datetime', + dateformat: 'yyyy-MM-dd hh:mm:ss' + })); + _$item.append($('测量时间段:
').dataFormatter({ + value: _item.MeasureTime, + type: 'dataItem', + code: 'MeasureTime' + })); + return ''; + }, + rowClick: function (item, $item, $page) {// 列表行点击触发方法 + learun.nav.go({ path: 'EducationalAdministration/Thermography/form', title: '详情', type: 'right', param: { keyValue: item.ID } }); + }, + btnClick: function (item, $item, $page) {// 左滑按钮点击事件 + learun.layer.confirm('确定要删除该笔数据吗?', function (_index) { + if (_index === '1') { + learun.layer.loading(true, '正在删除该笔数据'); + learun.httppost(config.webapi + 'learun/adms/EducationalAdministration/Thermography/delete', item.ID, (data) => { + if (data) {// 删除数据成功 + page.grid.reload(); + } + learun.layer.loading(false); + }); + } + }, '智慧校园提示', ['取消', '确定']); + }, + //rowBtns: ['删除'] // 列表行左滑按钮 + }; + return page; +})(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.css b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.css index 8ef6f50ab..8db6708d1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.css +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.css @@ -202,7 +202,7 @@ li { border-color: #cacaca !important; } */ -.timeTableBtn { +.timeTableBtn,.submitBtn { font-size: 16px; margin: 20px 12px; background: #0C86D8; @@ -211,6 +211,7 @@ li { line-height: 40px; height: 40px; color: #fff; + cursor:pointer; } .statusType { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.html b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.html index f81c12eb3..a932ff8d9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.html +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/Thermography/measure/measure.html @@ -27,6 +27,7 @@