From dc19fa51e72e3bf0ecec5e0a4fae33cfbae4ec34 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 17:56:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Edevice=E6=AC=84=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 9 +++++---- FrontendWebApi/Models/Device.cs | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index c4bf115..5161106 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -259,19 +259,20 @@ namespace FrontendWebApi.ApiControllers /// /// /// - [HttpPost] + [HttpGet] [Route("api/Device/GetOpeDevice")] - public async Task>>> GetOpeDevice([FromBody] FindDevice fd) + public async Task>>> GetOpeDevice([FromQuery] string device_guid) { ApiResult> apiResult = new ApiResult>(); try { - string sql = $@"select orr.work_type, orr.fix_do, ui.full_name as work_person_name, finish_time, created_at + string sql = $@"select orr.work_type, orr.fix_do, ui.full_name as work_person_name, orr.finish_time, orr.created_at, dn.device_node_guid, dn.full_name as device_node_name from device d join operation_record orr on d.device_number = orr.fix_do_code and orr.deleted = 0 left join userinfo ui on orr.work_person_id = ui.userinfo_guid + left join device_node dn on d.device_guid = dn.device_guid where d.deleted = 0 and d.device_guid = @device_guid"; - object param = new { @device_guid = fd.device_guid }; + object param = new { @device_guid = device_guid }; var device = await backendRepository.GetAllAsync(sql, param); if (device.Count == 0) diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index d35bbec..f671d5c 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -110,5 +110,7 @@ namespace FrontendWebApi.Models return Convert.ToDateTime(finish_time).ToString("yyyy-MM-dd HH:mm:ss"); } } //結束時間 + public string device_node_guid { get; set; } + public string device_node_name { get; set; } } }