|
@@ -86,7 +86,7 @@ namespace Ropin.Inspection.Api.Controllers.Base
|
|
|
public async Task<ApiResult> AiAlmSaveMessage()
|
|
|
{
|
|
|
//40124884581189;33379713109829
|
|
|
- var data = await aIHelper.GetAlmDispose("", 1, 100, 40124884581189);
|
|
|
+ var data = await aIHelper.GetAlmDispose("", 1, 10, 40124884581189);
|
|
|
//var data = await aIHelper.GetHistoricAlmrecord("", 1, 10, 40124884581189);
|
|
|
if (data != null)
|
|
|
{
|
|
@@ -160,45 +160,43 @@ namespace Ropin.Inspection.Api.Controllers.Base
|
|
|
[Route("/device/business/generalApp/pushData/alarmData/{deviceNo}")]
|
|
|
public async Task<ApiResultModel<object>> AlarmData([FromRoute] string deviceNo, [FromBody] AlarmDataModel alarmDataModel)
|
|
|
{
|
|
|
- Console.WriteLine("/device/business/generalApp/pushData/alarmData");
|
|
|
- Console.WriteLine("deviceNo" + deviceNo);
|
|
|
- //var devIds = await _vmcCameraService.GetCameraByTDH(alarmDataModel.deviceNo);
|
|
|
- //int row = 0;
|
|
|
- //foreach (var x in devIds)
|
|
|
- //{
|
|
|
- // List<MessageFile> messageFiles = new List<MessageFile>();
|
|
|
- // var textJson = new
|
|
|
- // {
|
|
|
- // PanoramaId = alarmDataModel.panoramaId,
|
|
|
- // PanoramaUrl = alarmDataModel.panoramaUrl,
|
|
|
- // RoiJson = alarmDataModel.roiJson,
|
|
|
- // NonRoiJson = alarmDataModel.nonRoiJson,
|
|
|
- // DetectionFrameJson = alarmDataModel.detectionFrameJson
|
|
|
- // };
|
|
|
- // var datas = JsonConvert.SerializeObject(textJson);
|
|
|
- // MessageFile messageFile = new MessageFile();
|
|
|
- // messageFile.Text = datas;
|
|
|
- // messageFile.Type = "FILE_TYP_006";
|
|
|
- // messageFiles.Add(messageFile);
|
|
|
- // TpushMsgModel model = new TpushMsgModel
|
|
|
- // {
|
|
|
- // C_DevStoreCode = x,
|
|
|
- // C_MsgTypeCode = "MSG_TYPE_024",
|
|
|
- // Subject = "AI盒子报警",
|
|
|
- // Msg = alarmDataModel.alarmType,
|
|
|
- // UserName = "AI盒子",
|
|
|
- // UserMobile = "",
|
|
|
- // CreateOn = alarmDataModel.captureTime,
|
|
|
- // GenerationType = 1,
|
|
|
- // msgStatus = 1,
|
|
|
- // FileList = messageFiles
|
|
|
- // };
|
|
|
- // bool bol = await _pushMsgService.PushAlarmMsgAsync(model, model.Subject);
|
|
|
- // log.Info($"执行发送结果=[{bol}]");
|
|
|
- // if (bol) { row++; }
|
|
|
- //}
|
|
|
- //return ApiResultModel<object>.GetSuccess(row);
|
|
|
- return await Task.FromResult(ApiResultModel<object>.GetSuccess(new object { }));
|
|
|
+ var devIds = await _vmcCameraService.GetCameraByTDH(alarmDataModel.deviceNo);
|
|
|
+ int row = 0;
|
|
|
+ foreach (var x in devIds)
|
|
|
+ {
|
|
|
+ List<MessageFile> messageFiles = new List<MessageFile>();
|
|
|
+ var textJson = new
|
|
|
+ {
|
|
|
+ PanoramaId = alarmDataModel.panoramaId,
|
|
|
+ PanoramaUrl = alarmDataModel.panoramaUrl,
|
|
|
+ RoiJson = alarmDataModel.roiJson,
|
|
|
+ NonRoiJson = alarmDataModel.nonRoiJson,
|
|
|
+ DetectionFrameJson = alarmDataModel.detectionFrameJson
|
|
|
+ };
|
|
|
+ var datas = JsonConvert.SerializeObject(textJson);
|
|
|
+ MessageFile messageFile = new MessageFile();
|
|
|
+ messageFile.Text = datas;
|
|
|
+ messageFile.Type = "FILE_TYP_006";
|
|
|
+ messageFiles.Add(messageFile);
|
|
|
+ TpushMsgModel model = new TpushMsgModel
|
|
|
+ {
|
|
|
+ C_DevStoreCode = x,
|
|
|
+ C_MsgTypeCode = "MSG_TYPE_024",
|
|
|
+ Subject = "AI盒子报警",
|
|
|
+ Msg = alarmDataModel.alarmType,
|
|
|
+ UserName = "AI盒子",
|
|
|
+ UserMobile = "",
|
|
|
+ CreateOn = alarmDataModel.captureTime,
|
|
|
+ GenerationType = 1,
|
|
|
+ msgStatus = 1,
|
|
|
+ FileList = messageFiles
|
|
|
+ };
|
|
|
+ bool bol = await _pushMsgService.PushAlarmMsgAsync(model, model.Subject);
|
|
|
+ log.Info($"执行发送结果=[{bol}]");
|
|
|
+ if (bol) { row++; }
|
|
|
+ }
|
|
|
+ return ApiResultModel<object>.GetSuccess(row);
|
|
|
+ //return await Task.FromResult(ApiResultModel<object>.GetSuccess(new object { }));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|