Пример #1
0
 public static SearchManager GetInstance()
 {
     lock (lockthis)
     {
         if (_SearchManager == null)
         {
             _SearchManager = new SearchManager();
         }
     }
     return(_SearchManager);
 }
Пример #2
0
        /// <summary>
        /// 执法仪日志总数
        /// </summary>
        /// <param name="cls"></param>
        public void SearchCameraLogCount(CameraLogsSerach cls)
        {
            string UserGuid = string.Empty;
            string OrgID    = string.Empty;

            if (AppConfigInfos.CurrentUserInfos.UserType == "1")
            {
                if (cls.IsAdvanced)
                {
                    UserGuid = cls.UserGuid;
                    OrgID    = string.IsNullOrEmpty(cls.OrgID) ? AppConfigInfos.LimitsUserInfos.OrgIDCodeStr : cls.OrgID;
                }
                else
                {
                    OrgID = AppConfigInfos.LimitsUserInfos.OrgIDCodeStr;
                }
            }
            else
            {
                UserGuid = AppConfigInfos.CurrentUserInfos.UserGuid;
                OrgID    = AppConfigInfos.CurrentUserInfos.OrgID;
            }


            if (DateTime.Compare(Convert.ToDateTime(cls.CollectEndTime), DateTime.Now) > 0)
            {
                SearchManager.GetInstance().CameraLogsSerach.SearchTime = DateTime.Now.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                SearchManager.GetInstance().CameraLogsSerach.SearchTime = cls.CollectEndTime;
            }

            Conditions cons = new Conditions();

            cons.AddItem("UserGuid", UserGuid);
            cons.AddItem("OrgID", OrgID);
            cons.AddItem("DeviceID", cls.IsAdvanced ? cls.DeviceID : "");
            cons.AddItem("LogType", cls.LogType);
            cons.AddItem("UpLoadState", cls.IsAdvanced ? cls.UploadState : "");
            cons.AddItem("CollectStartTime", cls.CollectStartTime);
            cons.AddItem("CollectEndTime", cls.SearchTime);

            ModelResponsible.Instance.SendMessage(MsgType.LogCountRequest, cons);
        }
Пример #3
0
        /// <summary>
        /// 根据用户信息是否清楚缓存数据
        /// </summary>
        public void UpdateSearchData()
        {
            if (!AppConfigInfos.LimitsUserInfos.UserCode.Equals(CurrentUserInfo.UserCode))
            {
                CurrentUserInfo = AppConfigInfos.LimitsUserInfos;
                ModelResponsible.Instance.ClearPicturePlayMediaList();
                ModelResponsible.Instance.ClearVideoPlayMediaList();
                ModelResponsible.Instance.ClearVoicePlayMediaList();
                ModelResponsible.Instance.ClearHisPlayMediaList();
                ModelResponsible.Instance.ClearAlarmLogs();
                ModelResponsible.Instance.ClearCameraLogs();
                ModelResponsible.Instance.ClearCollectLogs();
                ModelResponsible.Instance.ClearMediaList();
                LogHelper.Instance.WirteLog(string.Format("SearchManager: UserCode:{0} UpdateSearchData  ClearAll", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug);

                SearchManager.GetInstance().MediaLogsSerach.PageIndex = 1;
                SearchManager.GetInstance().MediaLogsSerach.IsAdvanced = false;
                SearchManager.GetInstance().MediaLogsSerach.SearchTime = DateTime.Now.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
                SearchManager.GetInstance().SearchMediaLogCount(SearchManager.GetInstance().MediaLogsSerach);
                SearchManager.GetInstance().SearchMediaLogDetail(SearchManager.GetInstance().MediaLogsSerach, false);
                LogHelper.Instance.WirteLog(string.Format("SearchManager: UserCode:{0} UpdateSearchData  MediaLogsSerach", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug);

                SearchManager.GetInstance().CollectLogsSerach.PageIndex = 1;
                SearchManager.GetInstance().CollectLogsSerach.LogType = "1";
                SearchManager.GetInstance().CollectLogsSerach.IsAdvanced = false;
                SearchManager.GetInstance().SearchCollectLogCount(SearchManager.GetInstance().CollectLogsSerach);
                SearchManager.GetInstance().SearchCollectLogDetail(SearchManager.GetInstance().CollectLogsSerach, false);
                LogHelper.Instance.WirteLog(string.Format("SearchManager: UserCode:{0} UpdateSearchData  CollectLogsSerach", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug);

                SearchManager.GetInstance().CameraLogsSerach.PageIndex = 1;
                SearchManager.GetInstance().CameraLogsSerach.LogType = "2";
                SearchManager.GetInstance().CameraLogsSerach.IsAdvanced = false;
                SearchManager.GetInstance().SearchCameraLogCount(SearchManager.GetInstance().CameraLogsSerach);
                SearchManager.GetInstance().SearchCameraLogDetail(SearchManager.GetInstance().CameraLogsSerach, false);
                LogHelper.Instance.WirteLog(string.Format("SearchManager: UserCode:{0} UpdateSearchData  CameraLogsSerach", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug);

                SearchManager.GetInstance().AlarmLogsSearch.PageIndex = 1;
                SearchManager.GetInstance().AlarmLogsSearch.IsAdvanced = false;
                SearchManager.GetInstance().SearchAlarmLogCount(SearchManager.GetInstance().AlarmLogsSearch);
                SearchManager.GetInstance().SearchAlarmLogDetail(SearchManager.GetInstance().AlarmLogsSearch, false);
                LogHelper.Instance.WirteLog(string.Format("SearchManager: UserCode:{0} UpdateSearchData  AlarmLogsSearch", AppConfigInfos.CurrentUserInfos.UserCode), LogLevel.LogDebug);
            }
        }
Пример #4
0
        /// <summary>
        /// 告警总数
        /// </summary>
        /// <param name="als"></param>
        public void SearchAlarmLogCount(AlarmLogsSearch als)
        {
            if (DateTime.Compare(Convert.ToDateTime(als.AlarmtEndTime), DateTime.Now) > 0)
            {
                SearchManager.GetInstance().AlarmLogsSearch.SearchTime = DateTime.Now.AddSeconds(-1).ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                SearchManager.GetInstance().AlarmLogsSearch.SearchTime = als.AlarmtEndTime;
            }

            Conditions cons = new Conditions();

            cons.AddItem("AlarmLevel", als.IsAdvanced ? als.AlarmLevel : "");
            cons.AddItem("AlarmCode", als.IsAdvanced ? als.AlarmCode : "");
            cons.AddItem("AlarmModule", (als.IsAdvanced && !string.IsNullOrEmpty(als.AlarmModule))? als.AlarmModule : "16,17,18,21,23,25,28");
            cons.AddItem("AlarmStatus", als.IsAdvanced ? als.AlarmStatus : "");
            cons.AddItem("AlarmIp", EEMSConfigHelper.GetValueByCommomConfig("config/CommonConfig/local_machine_ip", "127.0.0.1"));
            cons.AddItem("AlarmStartTime", als.AlarmStartTime);
            cons.AddItem("AlarmEndTime", als.SearchTime);

            ModelResponsible.Instance.SendMessage(MsgType.AlarmCountRequest, cons);
        }