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