烟火信息订阅
parent
8682d3ab86
commit
0129d9045f
|
|
@ -54,6 +54,8 @@ namespace OpenAuth.App.Const
|
|||
[Description("小程序")]
|
||||
小程序 = 5,
|
||||
[Description("卫星遥感")]
|
||||
卫星遥感 = 6
|
||||
卫星遥感 = 6,
|
||||
[Description("摄像头")]
|
||||
摄像头 = 7
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1626,7 +1626,7 @@ ORDER BY
|
|||
/// 感知中心--摄像头类型数量统计
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<Response<dynamic>> GetCameraCountByType()
|
||||
public async Task<Response<List<CameraCountRes>>> GetCameraCountByType()
|
||||
{
|
||||
using (var db = base.UnitWork.CreateContext())
|
||||
{
|
||||
|
|
@ -1690,9 +1690,9 @@ ORDER BY
|
|||
}
|
||||
clist.Add(cs);
|
||||
}
|
||||
return new Response<dynamic>
|
||||
return new Response<List<CameraCountRes>>
|
||||
{
|
||||
Result = JsonConvert.SerializeObject(clist)
|
||||
Result = clist
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
using Infrastructure;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using OpenAuth.App.BaseApp.Base;
|
||||
using OpenAuth.App.Const;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.App.ServiceApp.FireManagement;
|
||||
using OpenAuth.App.ServiceApp.FireManagement.Request;
|
||||
using OpenAuth.App.ServiceApp.FireManagement.Response;
|
||||
using OpenAuth.Repository.Domain.FireManagement;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
|
||||
namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
||||
{
|
||||
|
|
@ -748,8 +752,13 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
|||
#endregion
|
||||
|
||||
#region 感知中心--摄像头类型
|
||||
/// <summary>
|
||||
/// 感知中心--摄像头类型统计
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Response<dynamic>> GetCameraCountByType()
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<List<CameraCountRes>>> GetCameraCountByType()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -757,7 +766,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new Response<dynamic>
|
||||
return new Response<List<CameraCountRes>>
|
||||
{
|
||||
Result = null,
|
||||
Message = ex.Message.ToString()
|
||||
|
|
@ -765,5 +774,44 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 海康火情订阅
|
||||
/// <summary>
|
||||
/// 海康 报警事件订阅回调方法 火点检测 192515,烟火检测 192514 ,烟雾检测 192513
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<Response<bool>> AddCameraFireInfo(dynamic str)
|
||||
{
|
||||
var param = JsonConvert.DeserializeObject<JObject>(str.ToString());
|
||||
FmFireclueInfo ewInfo = new FmFireclueInfo();
|
||||
ewInfo.Address = param["params"]["events"][0]["data"]["fireDetection"][0]["targetAttrs"]["cameraAddress"];
|
||||
ewInfo.EventId = param["params"]["events"][0]["eventId"];
|
||||
|
||||
ewInfo.ReportTime = param["params"]["events"][0]["happenTime"];
|
||||
ewInfo.Image = param["params"]["events"][0]["data"]["fielddetection"][0]["imageUrl"];
|
||||
//ewInfo.EWAddress = param["params"]["events"][0]["data"]["fielddetection"][0]["targetAttrs"]["cameraAddress"];
|
||||
ewInfo.CreateId = param["params"]["events"][0]["data"]["fielddetection"][0]["targetAttrs"]["cameraIndexCode"];
|
||||
ewInfo.Lat = param["params"]["events"][0]["data"]["fielddetection"][0]["targetAttrs"]["latitude"];
|
||||
ewInfo.Lng = param["params"]["events"][0]["data"]["fielddetection"][0]["targetAttrs"]["longitude"];
|
||||
ewInfo.SourceType = (int)SourceType.摄像头;
|
||||
ewInfo.State = (int)State.上报;
|
||||
ewInfo.AreaName = "feixian";
|
||||
Response<bool> response = new Response<bool>();
|
||||
try
|
||||
{
|
||||
return await _app.AddFireClueInfo(ewInfo);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
response.Code = 500;
|
||||
response.Message = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
|
||||
response.Result=false;
|
||||
return response;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue