/// <summary> /// 下发所有网络模块时间同步命令接口 /// </summary> /// <returns></returns> public BasicResponse SetNetworkModuleSyncTime() { BasicResponse result = new BasicResponse(); NetworkModuleCacheGetAllRequest networkModuleCacheRequest = new NetworkModuleCacheGetAllRequest(); var resultGet = _NetworkModuleCacheService.GetAllNetworkModuleCache(networkModuleCacheRequest); List <Jc_MacInfo> macItems = resultGet.Data; if (macItems != null && macItems.Any()) { foreach (Jc_MacInfo item in macItems) { item.TimeSynchronization = true; item.TimeSynchronizationcount = 3;//默认发3次网络模块时间同步命令 //更新指定字段到缓存中 Dictionary <string, object> paramater = new Dictionary <string, object>(); paramater.Add("TimeSynchronization", item.TimeSynchronization); paramater.Add("TimeSynchronizationcount", item.TimeSynchronizationcount); NetworkModuleCacheUpdatePropertiesRequest networkModuleCacheUpdatePropertiesRequest = new NetworkModuleCacheUpdatePropertiesRequest(); networkModuleCacheUpdatePropertiesRequest.Mac = item.MAC; networkModuleCacheUpdatePropertiesRequest.UpdateItems = paramater; _NetworkModuleCacheService.UpdateNetworkInfo(networkModuleCacheUpdatePropertiesRequest); } } return(result); }
/// <summary> /// 更新网络模块定义信息(只更新定义相关字段) /// </summary> /// <param name="item"></param> private void UpdateNetworkModuleCacheByProperty(Jc_MacInfo item) { Dictionary <string, object> paramater = new Dictionary <string, object>(); paramater.Add("IP", item.IP); paramater.Add("Wzid", item.Wzid); paramater.Add("Wz", item.Wz); paramater.Add("Istmcs", item.Istmcs); paramater.Add("Type", item.Type); paramater.Add("Bz1", item.Bz1); paramater.Add("Bz2", item.Bz2); paramater.Add("Bz3", item.Bz3); paramater.Add("Bz4", item.Bz4); paramater.Add("Bz5", item.Bz5); paramater.Add("Bz6", item.Bz6); paramater.Add("Upflag", item.Upflag); paramater.Add("IsMemoryData", item.IsMemoryData);//是否内存数据标记 //修改标记 paramater.Add("InfoState", item.InfoState); NetworkModuleCacheUpdatePropertiesRequest networkModuleCacheUpdatePropertiesRequest = new NetworkModuleCacheUpdatePropertiesRequest(); networkModuleCacheUpdatePropertiesRequest.Mac = item.MAC; networkModuleCacheUpdatePropertiesRequest.UpdateItems = paramater; _NetworkModuleCacheService.UpdateNetworkInfo(networkModuleCacheUpdatePropertiesRequest); }
/// <summary> /// 更新网络模块指定字段值 /// </summary> /// <param name="mac"></param> /// <param name="updateItems"></param> public static void UpdateNetworkModeuleCacheByPropertys(string mac, Dictionary <string, object> updateItems) { NetworkModuleCacheUpdatePropertiesRequest networkModuleCacheUpdatePropertiesRequest = new NetworkModuleCacheUpdatePropertiesRequest(); networkModuleCacheUpdatePropertiesRequest.Mac = mac; networkModuleCacheUpdatePropertiesRequest.UpdateItems = updateItems; networkModuleCacheService.UpdateNetworkInfo(networkModuleCacheUpdatePropertiesRequest); }
public static void UpdateNetWorkInfoByProperties(string pointID, Dictionary <string, object> paramater) { try { NetworkModuleCacheUpdatePropertiesRequest pointDefineCacheRequest = new NetworkModuleCacheUpdatePropertiesRequest(); pointDefineCacheRequest.Mac = pointID; pointDefineCacheRequest.UpdateItems = paramater; networkModuleService.UpdateNetworkInfo(pointDefineCacheRequest); } catch (Exception ex) { LogHelper.Error("ElectricityStatistics-UpdateNetWorkInfoByProperties Error【Mac = " + pointID + "】" + ex.Message); } }
public BasicResponse UpdateNetworkInfo(NetworkModuleCacheUpdatePropertiesRequest pointDefineCacheRequest) { NetworkModuleCache.NetworModuleCahceInstance.UpdateNetworkInfo(pointDefineCacheRequest.Mac, pointDefineCacheRequest.UpdateItems); return(new BasicResponse()); }