using Microsoft.AspNetCore.Mvc; using System; using System.Linq; using System.Text; using System.Text.RegularExpressions; using VideoSurveillanceAdapter; using Yunda.ISAS.DataMonitoringServer.DataAnalysis; using Yunda.ISAS.DataMonitoringServer.DataAnalysis.DataCollection; using Yunda.ISAS.DataMonitoringServer.DataAnalysis.Model; using Yunda.ISAS.DataMonitoringServer.DataCenter; using YunDa.ISAS.DataTransferObject; using YunDa.ISAS.DataTransferObject.VideoSurveillance.VideoDevDto; namespace Yunda.ISAS.DataMonitoringServer.WebApi.Controllers { [Route("isas/api/dataMonitoringService/yk/[action]")] public class YkController { private readonly CameraDataCenter _cameraDataCenter; public YkController(/*CameraDataCenter cameraDataCenter*/) { _cameraDataCenter = WebApiServer._cameraDataCenter; } public string Index() { return "Hello DataMonitoringService!"; } [HttpGet] public RequestEasyResult ExcuteYk( [FromQuery] int dispatcherAddr, int ykValue) { RequestEasyResult requestEasyResult = new RequestEasyResult(); try { if (dispatcherAddr>0) { var list = TimeWorkService._webApiRequest.GetTelecommandDatas(TimeWorkService._configurationHepler.SubstationId, dispatcherAddr); if (list!=null&& list.Count>0) { TimeWorkService._teleCommandDataSendTask.TelecommandTActionBlock.Post(new TelcommandDataModel() { Telecommand = new TelecommandModel() { Id = (Guid)list.First().Id, CommandValue = ykValue, CPUSector = list.First().CPUSector, DeviceAddress = list.First().DeviceAddress, DispatcherAddress = list.First().DispatcherAddress, InfoAddress = list.First().InfoAddress, Sender = "门禁网关定时遥控", Source = "门禁网关" } }); requestEasyResult.Flag = true; } } } catch (Exception ex) { requestEasyResult.Message = ex.Message; MonitoringEventBus.LogHandler(ex.Message, "异常信息"); } return requestEasyResult; } } }