예제 #1
0
        /// <summary>
        /// 保存巡检
        /// </summary>
        /// <returns></returns>
        public BasicResponse SaveInspection()
        {
            DateTime      SaveTime = DateTime.Now;
            BasicResponse Result   = new BasicResponse();

            //测点定义保存巡检(安全监控)
            _PointDefineService.PointDefineSaveData();

            //测点定义保存巡检(人员定位)  20171123
            _PersonPointDefineService.PointDefineSaveData();

            //网络模块管理保存巡检
            _NetworkModuleService.NetworkModuleSaveData();

            ////保存定义更新时间
            //if (Basic.Framework.Data.PlatRuntime.Items.ContainsKey("_DefUpdateTime"))
            //{
            //    Basic.Framework.Data.PlatRuntime.Items["_DefUpdateTime"] = SaveTime;
            //}
            //else
            //{
            //    Basic.Framework.Data.PlatRuntime.Items.Add("_DefUpdateTime", SaveTime);
            //}

            ////保存数据库
            //ConfigInfo tempConfig = new ConfigInfo();
            //tempConfig.Name = "defdatetime";
            //tempConfig.Text = SaveTime.ToString("yyyy-MM-dd HH:mm:ss");
            //tempConfig.Upflag = "0";
            //ConfigCacheGetByKeyRequest configCacheRequest = new ConfigCacheGetByKeyRequest();
            //configCacheRequest.Name = "defdatetime";
            //var result = _ConfigCacheService.GetConfigCacheByKey(configCacheRequest);
            //ConfigInfo tempConfigCache = result.Data;
            //if (tempConfig != null)
            //{
            //    tempConfig.ID = tempConfigCache.ID;
            //    tempConfig.InfoState = InfoState.Modified;
            //    //更新数据库
            //    var request = ObjectConverter.Copy<ConfigInfo, ConfigModel>(tempConfig);
            //    _Repository.UpdateConfig(request);
            //    //更新缓存
            //    ConfigCacheUpdateRequest UpdateConfigCacheRequest = new ConfigCacheUpdateRequest();
            //    UpdateConfigCacheRequest.ConfigInfo = tempConfig;
            //    _ConfigCacheService.UpdateConfigCahce(UpdateConfigCacheRequest);
            //}
            var req = new SaveInspectionInRequest
            {
                SaveTime = SaveTime
            };

            SaveInspectionIn(req);

            return(Result);
        }
 public BasicResponse PointDefineSaveData()
 {
     return(_PointDefineService.PointDefineSaveData());
 }