From 8875417e88ad899e97d55ec3434532fca3467d2c Mon Sep 17 00:00:00 2001 From: dao Date: Tue, 15 Oct 2024 16:55:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E8=AE=BE=E5=A4=87=E5=BC=80?= =?UTF-8?q?=E9=97=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ADR_DeviceController.cs | 24 +++++++++++++++++++ .../Views/ADR_Device/Index.cshtml | 6 +++-- .../Views/ADR_Device/Index.js | 13 ++++++++++ .../XmlConfig/system.config | 2 ++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ADR_DeviceController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ADR_DeviceController.cs index 93e3321c9..4f3b62c0e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ADR_DeviceController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ADR_DeviceController.cs @@ -3,6 +3,8 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System.Configuration; +using System.Net.Http; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -94,6 +96,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("删除成功!"); } /// + /// 开门 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoorForm(string keyValue) + { + var url = ConfigurationManager.AppSettings["HkOpenDoor"]; + var close=false; + using (var client=new HttpClient()) + { + var r=client.GetAsync($"{url}{keyValue}?c={close}").Result; + if(r.IsSuccessStatusCode) + { + var str=r.Content.ReadAsStringAsync().Result; + return Success(str); + } + return Fail("开门失败"); + } + } + /// /// 保存实体数据(新增、修改) /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.cshtml index 3963570b2..ac4e67429 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.cshtml @@ -13,10 +13,12 @@
-  新增 -  编辑 +  新增 +  编辑  删除
+ +  开门
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.js index d2894b287..4776a20d3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ADR_Device/Index.js @@ -59,6 +59,19 @@ var bootstrap = function ($, learun) { }); } }); + //开门 + $('#lr_print').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('确认开门吗!', function (res) { + if (res) { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ADR_Device/DoorForm', { keyValue: keyValue }, function () { + + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index d9c2a3146..ed7c0ba64 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -196,4 +196,6 @@ + + \ No newline at end of file