public void TestGetAlarmDeviceFreeTimeViewModelByBuidID() { DateTime today = DateTime.Now; AlarmDeviceFreeTimeService service = new AlarmDeviceFreeTimeService(); AlarmDeviceFreeTimeViewModel ViewModel = service.GetViewModel("000001G001", today.ToString("yyyy-MM-dd")); Console.WriteLine(UtilTest.GetJson(ViewModel)); }
/// <summary> /// 获取设备用能越限告警(设定时间段内用能超过设置起始时间的前一个小时的值) /// </summary> /// <param name="buildId">建筑ID</param> /// <param name="date">时间("yyyy-MM-dd")</param> /// <returns></returns> public object Get(string buildId, string date) { try { return(service.GetViewModel(buildId, date)); } catch (Exception e) { return(e.Message); } }