diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs
index 09fac2b..a9ec4b8 100644
--- a/FrontendWebApi/ApiControllers/DeviceManageController.cs
+++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs
@@ -812,7 +812,7 @@ namespace FrontendWebApi.ApiControllers
catch (Exception exception)
{
apiResult.Code = "9999";
- Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
+ Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception);
return Ok(apiResult);
}
return Ok(apiResult);
@@ -1183,17 +1183,26 @@ namespace FrontendWebApi.ApiControllers
///
[HttpPost]
[Route("api/Device/GetDisasterDevice")]
- public async Task>>> GetDisasterDevice()
+ public async Task>>> GetDisasterDevice([FromBody] FindDeviceDisaster fdd)
{
ApiResult> apiResult = new ApiResult>();
try
{
- var sqlString = $@" SELECT * FROM device_disaster";
- var fr = await backendRepository.GetAllAsync(sqlString);
+ var result = new List();
+ var sqlString = $@" SELECT * FROM device_disaster WHERE 1=1";
+ if (fdd != null)
+ {
+ if (!string.IsNullOrEmpty(fdd.building_tag)) {
+ sqlString += " AND device_building_tag = @building_tag";
+ }
+ }
+
+ result = await backendRepository.GetAllAsync(sqlString,fdd);
+
apiResult.Code = "0000";
- apiResult.Data = fr;
+ apiResult.Data = result;
}
catch (Exception exception)
{
diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs
index 4cf8b13..7213f07 100644
--- a/FrontendWebApi/Models/Device.cs
+++ b/FrontendWebApi/Models/Device.cs
@@ -215,4 +215,8 @@ namespace FrontendWebApi.Models
public string device_number { get; set; }
}
+ public class FindDeviceDisaster
+ {
+ public string building_tag { get; set; }
+ }
}