private void StartAlarms(List <JC_MbInfo> alarmInfoItems)
        {
            //入库
            string[] colNameItems         = { "Id", "PointID", "fzh", "kh", "dzh", "devid", "wzid", "point", "type", "bstj", "bsz", "stime", "etime", "ssz", "pjz" };
            System.Data.DataColumn[] cols = new System.Data.DataColumn[colNameItems.Length];
            for (int i = 0; i < cols.Length; i++)
            {
                cols[i] = new System.Data.DataColumn(colNameItems[i]);
            }
            alarmInfoItems.ForEach(item =>
            {
                JC_MbModel _jcmb = ObjectConverter.Copy <JC_MbInfo, JC_MbModel>(item);
                mbRepository.AddItemBySql(_jcmb);
            });
            //添加内存
            RatioAlarmCacheBatchAddRequest ratioAlarmCacheBatchAddRequest = new RatioAlarmCacheBatchAddRequest();

            ratioAlarmCacheBatchAddRequest.AlarmInfos = alarmInfoItems;
            ratioAlarmCacheService.BacthAddAlarmCache(ratioAlarmCacheBatchAddRequest);
        }
Ejemplo n.º 2
0
 public BasicResponse BacthAddAlarmCache(RatioAlarmCacheBatchAddRequest alarmCacheRequest)
 {
     RatioAlarmCache.AlarmCacheInstance.AddItems(alarmCacheRequest.AlarmInfos);
     return(new BasicResponse());
 }
        /// <summary>
        /// 批量添加报警缓存
        /// </summary>
        /// <param name="alarmCacheRequest"></param>
        /// <returns></returns>
        public BasicResponse BacthAddAlarmCache(RatioAlarmCacheBatchAddRequest alarmCacheRequest)
        {
            var responsestr = HttpClientHelper.Post(Webapi + "/v1/ratioalarm/BacthAddAlarmCache?token=" + Token, JSONHelper.ToJSONString(alarmCacheRequest));

            return(JSONHelper.ParseJSONString <BasicResponse>(responsestr));
        }
 public BasicResponse BacthAddAlarmCache(RatioAlarmCacheBatchAddRequest alarmCacheRequest)
 {
     return(alarmService.BacthAddAlarmCache(alarmCacheRequest));
 }