/// <summary> /// 清除手动控制 2017.3.22 by /// </summary> /// <param name="ID"></param> /// <returns></returns> public static bool DoDoJCSDKZ(List <Jc_JcsdkzInfo> items) { //IJC_JCSDKZService JCSDKZService = ServiceFactory.CreateService<IJC_JCSDKZService>(); //return JCSDKZService.DelJCSKZs(items); var req = new ManualCrossControlsRequest { ManualCrossControlInfos = items }; var res = ManualCrossControlCacheService.DeleteManualCrossControls(req); if (!res.IsSuccess) { throw new Exception(res.Message); } return(res.IsSuccess); }
/// <summary> /// 报警,应急联动 /// </summary> /// <param name="args"></param> private void DataAnalysisService_AnalysisReulstHandlerEvent(AnalysisChangedEventArgs args) { try { JC_LargedataAnalysisConfigInfo analysisConfigInfo = args.AnalysisConfig; string analysisModelId = analysisConfigInfo.Id; List <JC_AlarmNotificationPersonnelConfigInfo> responseAlarmConfigList; JC_EmergencyLinkageConfigInfo responseEmergencyLinkageConfig; List <JC_RegionOutageConfigInfo> responseRegionOutageConfigList; //多系统融合应急联动 SysEmergencyLinkageInfo responsesysEmergencyLinkInfo; //分析模板传感器分级报警配置 Jc_AnalysistemplatealarmlevelInfo analysistemplatealarmlevelInfo; try { responseAlarmConfigList = AlarmConfigCache.Instance.Query(q => q.AnalysisModelId == analysisModelId); responseEmergencyLinkageConfig = EmergencyLinkageConfigCache.Instance.Query(q => q.AnalysisModelId == analysisModelId).FirstOrDefault(); responseRegionOutageConfigList = RegionOutageConfigCache.Instance.Query(q => q.AnalysisModelId == analysisModelId); // //responsesysEmergencyLinkInfos = SysEmergencyLinkageCache.Instance.Query(o => o.MasterModelId == analysisModelId && o.Type == 2).FirstOrDefault(); responsesysEmergencyLinkInfo = sysEmergencyLinkageService.GetAllSysEmergencyLinkageList().Data.FirstOrDefault(o => o.MasterModelId == analysisModelId && o.Type == 2); AnalysistemplatealarmlevelGetByAnalysistemplateIdRequest cacherequest = new AnalysistemplatealarmlevelGetByAnalysistemplateIdRequest(); cacherequest.AnalysistemplateId = analysisModelId; analysistemplatealarmlevelInfo = analysistemplatealarmlevelService.GetAnalysistemplatealarmlevelByAnalysistemplateId(cacherequest).Data; } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("获取输出配置信息出错:{0}", ex.StackTrace)); return; } #region 报警配置 //存在报警配置 if (responseAlarmConfigList != null && responseAlarmConfigList.Count > 0) { try { //报警 BasicResponse <JC_AlarmHandleInfo> alarmHandleResponse = alarmHandleService.GetUnclosedAlarmByAnalysisModelId(new AlarmHandleGetByAnalysisModelIdRequest() { AnalysisModelId = analysisModelId }); if (analysisConfigInfo.AnalysisResult == 2) { if (alarmHandleResponse.Data == null) { //报警消息格式: 测点号+安装位置+分析模型名称+输出结果 StringBuilder alarmMessage = new StringBuilder(); var analysisSuccessfulPointList = ObjectConverter.CopyList <AnalysisSuccessfulPointInfo, AnalysisSuccessfulPointInfo>(analysisConfigInfo.AnalysisSuccessfulPointList); foreach (var item in analysisSuccessfulPointList) { alarmMessage.Append(string.Format("{0} {1} {2} {3}", item.Point, item.Wz, analysisConfigInfo.Name, analysisConfigInfo.TrueDescription)).Append(Environment.NewLine); } alarmHandleService.AddJC_AlarmHandle(new AlarmHandleAddRequest() { JC_AlarmHandleInfo = new JC_AlarmHandleInfo() { Id = IdHelper.CreateLongId().ToString(), AnalysisModelId = analysisModelId, AnalysisResult = alarmMessage.ToString(), StartTime = DateTime.Now, AlarmType = responseAlarmConfigList[0].AlarmType, AlarmColor = responseAlarmConfigList[0].AlarmColor, EndTime = new DateTime(1900, 1, 1, 0, 0, 0) } }); } } else { //不成立或未知更新报警结束时间 if (alarmHandleResponse.Data != null) { alarmHandleResponse.Data.EndTime = DateTime.Now; alarmHandleService.UpdateJC_AlarmHandle(new AlarmHandleUpdateRequest() { JC_AlarmHandleInfo = alarmHandleResponse.Data }); } } } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("添加或更新报警信息出错:{0}", ex.StackTrace)); } } #endregion #region 应急联动 //应急联动 if (analysisConfigInfo.AnalysisResult == 2 && responseEmergencyLinkageConfig != null) { analysisConfigInfo.IsEmergencyLinkage = true; analysisConfigInfo.EmergencyLinkageConfig = responseEmergencyLinkageConfig.Coordinate; } else { //不成立或未知解除应急联动 analysisConfigInfo.IsEmergencyLinkage = false; analysisConfigInfo.EmergencyLinkageConfig = string.Empty; } try { largeDataAnalysisCacheClientService.UpdateLargeDataAnalysisConfigCahce(new LargeDataAnalysisConfigCacheUpdateRequest() { //LargeDataAnalysisConfigInfo = ObjectConverter.DeepCopy<JC_LargedataAnalysisConfigInfo>(analysisConfigInfo) LargeDataAnalysisConfigInfo = analysisConfigInfo }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("更新应急联动配置信息到缓存出错:{0}", ex.StackTrace)); } #endregion #region 区域断电 //存在区域断电配置 if (responseRegionOutageConfigList != null && responseRegionOutageConfigList.Count > 0) { //分析成立时 if (analysisConfigInfo.AnalysisResult == 2) { //要控制的列表 List <Jc_JcsdkzInfo> controlList = new List <Jc_JcsdkzInfo>(); //要解控的列表 List <Jc_JcsdkzInfo> removeControlList = new List <Jc_JcsdkzInfo>(); foreach (var item in responseRegionOutageConfigList) { BasicResponse <List <Jc_JcsdkzInfo> > analysisBKResponse; try { BasicResponse <bool> controlPointLegalResponse = pointDefineService.ControlPointLegal(new Sys.Safety.Request.PointDefine.PointDefineGetByPointIDRequest() { PointID = item.PointId }); if (!controlPointLegalResponse.Data) { //风电闭锁控制口或者甲烷风电闭锁控制口,数据分析这边不处理.如果风电闭锁和甲烷风电闭锁后定义并且当前控制口已被控制则解除控制。 analysisBKResponse = manualCrossControlService.GetManualCrossControlByTypeZkPointBkPoint(new ManualCrossControlGetByTypeZkPointBkPointRequest() { ZkPoint = analysisModelId, BkPoint = item.Point, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff }); if (analysisBKResponse.Data != null && analysisBKResponse.Data.Count > 0) { try { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = analysisBKResponse.Data }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("解除控制出错:{0}", ex.StackTrace)); } } continue; } } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("风电闭锁控制口或者甲烷风电闭锁控制口,数据分析这边不处理:{0}", ex.StackTrace)); } try { //查询测点为item.Point的被控列表 analysisBKResponse = manualCrossControlService.GetManualCrossControlByBkPoint(new ManualCrossControlGetByBkPointRequest() { BkPoint = item.Point }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("查询测点为item.Point的被控列表出错:{0}", ex.StackTrace)); continue; } //控制 if (item.ControlStatus == 1) { //删除此处判断,添加了模型成立后,再添加区域断电,不会控制 20180919 ////如果上一次也是分析成立,则不再添加控制,为了避免一边添加控制一边解除控制这种情况。 //if (analysisConfigInfo.PrevAnalysisResult == analysisConfigInfo.AnalysisResult) // continue; if (analysisBKResponse.Data != null && analysisBKResponse.Data.Count > 0) { //被控测点 item.Point 已经存在控制,不能再控. continue; } else { //向 jc_jcsdkz 插入数据 if (!controlList.Exists(p => p.ZkPoint == item.AnalysisModelId && p.Bkpoint == item.Point)) { controlList.Add(new Jc_JcsdkzInfo() { ID = IdHelper.CreateLongId().ToString(), ZkPoint = item.AnalysisModelId, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff, Upflag = "0", Bkpoint = item.Point }); } } } //解除控制 if (item.ControlStatus == 0) { //表 jc_jcsdkz 存在被控测点为当前解控测点的记录. if (analysisBKResponse.Data != null && analysisBKResponse.Data.Count > 0) { //如果表 jc_jcsdkz 存在和当前解控模型和当前解控测点有关的控制则解除. Jc_JcsdkzInfo JkInfo = analysisBKResponse.Data.FirstOrDefault(q => q.ZkPoint == item.RemoveModelId && q.Bkpoint == item.Point && q.Type == (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff); if (JkInfo != null) { removeControlList.Add(new Jc_JcsdkzInfo() { ID = JkInfo.ID, ZkPoint = JkInfo.ZkPoint, Bkpoint = JkInfo.Bkpoint, Type = JkInfo.Type, Upflag = JkInfo.Upflag }); } } } } if (controlList.Count > 0) { try { manualCrossControlService.AddManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = controlList }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("添加控制出错:{0}", ex.StackTrace)); } } if (removeControlList.Count > 0) { try { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = removeControlList }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("解除控制出错:{0}", ex.StackTrace)); } } } else { BasicResponse <List <Jc_JcsdkzInfo> > analysisZKResponse = null; try { //查询主控为analysisModelId的列表 analysisZKResponse = manualCrossControlService.GetManualCrossControlByTypeZkPoint(new ManualCrossControlGetByTypeZkPointRequest() { ZkPoint = analysisModelId, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("查询主控为{0}的列表出错:{1}", analysisModelId, ex.StackTrace)); } if (analysisZKResponse != null && analysisZKResponse.Data != null && analysisZKResponse.Data.Count > 0) { //不成立或未知时,首先看表达式测点是否还存在。 如果不存在, 分析模型控制的测点全部解除控制. foreach (var modelPoint in analysisConfigInfo.AnalysisModelPointRecordInfoList) { Jc_DefInfo definedPoint = null; try { definedPoint = PointCache.Instance.Query(q => q.PointID == modelPoint.PointId, false).FirstOrDefault(); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("获取测点缓存信息出错, 错误消息:{0}", ex.StackTrace)); } if (PointCache.Instance.Count > 0 && definedPoint == null /*测点不存在*/) { try { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = analysisZKResponse.Data }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("解除控制出错:{0}", ex.StackTrace)); } return; } } //不成立或未知时解除分析成立时所加的控制 List <Jc_JcsdkzInfo> removeControlList = new List <Jc_JcsdkzInfo>(); foreach (var item in responseRegionOutageConfigList) { try { BasicResponse <bool> controlPointLegalResponse = pointDefineService.ControlPointLegal(new Sys.Safety.Request.PointDefine.PointDefineGetByPointIDRequest() { PointID = item.PointId }); if (!controlPointLegalResponse.Data) { //风电闭锁控制口或者甲烷风电闭锁控制口,数据分析这边不处理.如果风电闭锁和甲烷风电闭锁后定义并且当前控制口已被控制则解除控制。 BasicResponse <List <Jc_JcsdkzInfo> > analysisBKResponse = manualCrossControlService.GetManualCrossControlByTypeZkPointBkPoint(new ManualCrossControlGetByTypeZkPointBkPointRequest() { ZkPoint = analysisModelId, BkPoint = item.Point, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff }); if (analysisBKResponse.Data != null && analysisBKResponse.Data.Count > 0) { try { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = analysisBKResponse.Data }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("解除控制出错:{0}", ex.StackTrace)); } } continue; } } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("风电闭锁控制口或者甲烷风电闭锁控制口,数据分析这边不处理:{0}", ex.StackTrace)); } //是否配置当分析不成立时解除分析成立时所加的控制. 1-解除控制 if (item.ControlStatus == 1 && item.IsRemoveControl == 1) { Jc_JcsdkzInfo JkInfo = analysisZKResponse.Data.FirstOrDefault(q => q.ZkPoint == item.AnalysisModelId && q.Bkpoint == item.Point && q.Type == (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff); if (JkInfo != null) { removeControlList.Add(new Jc_JcsdkzInfo() { ID = JkInfo.ID, ZkPoint = JkInfo.ZkPoint, Bkpoint = JkInfo.Bkpoint, Type = JkInfo.Type, Upflag = JkInfo.Upflag }); } } } if (removeControlList.Count > 0) { try { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = removeControlList }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("解除控制出错:{0}", ex.StackTrace)); } } } } } else { try { //没有区域断电配置. BasicResponse <List <Jc_JcsdkzInfo> > analysisZKResponse = manualCrossControlService.GetManualCrossControlByTypeZkPoint(new ManualCrossControlGetByTypeZkPointRequest() { ZkPoint = analysisModelId, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff }); if (analysisZKResponse != null && analysisZKResponse.Data != null && analysisZKResponse.Data.Count > 0) { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = analysisZKResponse.Data }); } } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("没有区域断电配置时删除控制出错:{0}", ex.StackTrace)); } } #endregion #region 多系统融合应急联动 if (responsesysEmergencyLinkInfo != null && !string.IsNullOrEmpty(responsesysEmergencyLinkInfo.Id)) { SysEmergencyLinkHandle(analysisConfigInfo, responsesysEmergencyLinkInfo); } #endregion #region 感器分级报警 if (analysistemplatealarmlevelInfo != null) { AnalysistemplateAlarmLevelHandle(analysisConfigInfo, analysistemplatealarmlevelInfo); } //如果报警配置等级不存在,则更新模型关联传感器报警等级为0 else { ManualCrossControlGetByTypeZkPointRequest mcrequest = new ManualCrossControlGetByTypeZkPointRequest(); mcrequest.Type = 12; mcrequest.ZkPoint = analysisConfigInfo.Id; var kzinfo = manualCrossControlService.GetManualCrossControlByTypeZkPoint(mcrequest).Data; if (kzinfo.Count > 0) { kzinfo.ForEach(kz => kz.Upflag = "0"); ManualCrossControlsRequest updaterequest = new ManualCrossControlsRequest(); updaterequest.ManualCrossControlInfos = kzinfo; manualCrossControlService.UpdateManualCrossControls(updaterequest); } } #endregion //更新上一次的分析结果 Dictionary <string, object> upddateitems = new Dictionary <string, object>(); upddateitems.Add("PrevAnalysisResult", analysisConfigInfo.AnalysisResult); if (analysisConfigInfo.AnalysisTime != null) { upddateitems.Add("PrevAnalysisTime", analysisConfigInfo.AnalysisTime.Value); } AnalysisModelCache.Instance.UpdateProperties(analysisConfigInfo.Id, upddateitems); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(ex.ToString()); } }
public BasicResponse DeleteManualCrossControls(Sys.Safety.Request.ManualCrossControl.ManualCrossControlsRequest ManualCrossControlRequest) { return(_ManualCrossControlService.DeleteManualCrossControls(ManualCrossControlRequest)); }
/// <summary> /// 批量新增区域断点设置 /// </summary> /// <param name="jC_RegionOutageConfigListAddRequest"></param> /// <returns></returns> public BasicResponse <List <JC_RegionOutageConfigInfo> > AddJC_RegionOutageConfigList(RegionOutageConfigListAddRequest jC_RegionOutageConfigListAddRequest) { string analysisModelId = jC_RegionOutageConfigListAddRequest.AnalysisModelId; var _jC_RegionOutageConfig = ObjectConverter.CopyList <JC_RegionOutageConfigInfo, JC_RegionoutageconfigModel>(jC_RegionOutageConfigListAddRequest.JC_RegionOutageConfigInfoList); List <JC_RegionoutageconfigModel> updateList = _jC_RegionOutageConfig == null ? new List <JC_RegionoutageconfigModel>() : _jC_RegionOutageConfig.ToList(); List <JC_RegionoutageconfigModel> regionOutageByModelList = _Repository.GetRegionOutageConfigListByAnalysisModelId(analysisModelId); List <JC_RegionoutageconfigModel> removeList = new List <JC_RegionoutageconfigModel>(); List <Jc_JcsdkzInfo> removeSDKZControlList = new List <Jc_JcsdkzInfo>(); if (regionOutageByModelList != null && regionOutageByModelList.Count > 0) { var oriControlList = regionOutageByModelList.Where(q => q.ControlStatus == 1).ToList(); //var oriRemoveControlList = regionOutageByModelList.Where(q => q.ControlStatus == 0).ToList(); foreach (var item in oriControlList) { if (!updateList.Where(q => q.ControlStatus == 1).ToList().Exists(q => q.PointId == item.PointId)) { removeList.Add(item); } } /* * foreach (var item in oriRemoveControlList) * { * if (!updateList.Where(q => q.ControlStatus == 0).ToList().Exists(q => q.PointId == item.PointId)) * { * var switchModelId = ObjectConverter.Copy<JC_RegionoutageconfigModel, JC_RegionoutageconfigModel>(item); * switchModelId.AnalysisModelId = switchModelId.RemoveModelId; * removeList.Add(switchModelId); * } * } */ } if (removeList.Count > 0) { IEnumerable <IGrouping <string, JC_RegionoutageconfigModel> > removeSDKZModelGroup = removeList.GroupBy(p => p.AnalysisModelId); foreach (var removeSDKZModelList in removeSDKZModelGroup) { string queryAnalysisModelId = removeSDKZModelList.FirstOrDefault().AnalysisModelId; BasicResponse <List <Jc_JcsdkzInfo> > analysisZKResponse = manualCrossControlService.GetManualCrossControlByTypeZkPoint(new ManualCrossControlGetByTypeZkPointRequest() { ZkPoint = queryAnalysisModelId, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff }); if (analysisZKResponse != null && analysisZKResponse.Data != null && analysisZKResponse.Data.Count > 0) { foreach (var removeSDKZModel in removeSDKZModelList) { BasicResponse <Jc_DefInfo> cachedPoint = pointDefineCacheService.PointDefineCacheByPointIdRequeest(new Sys.Safety.Request.Cache.PointDefineCacheByPointIdRequeest() { PointID = removeSDKZModel.PointId }); if (null != cachedPoint && cachedPoint.Data != null) { Jc_JcsdkzInfo removeSDKZInfo = analysisZKResponse.Data.FirstOrDefault(q => q.Bkpoint == cachedPoint.Data.Point); if (null != removeSDKZInfo) { removeSDKZControlList.Add(removeSDKZInfo); } } } } } } TransactionsManager.BeginTransaction(() => { if (removeSDKZControlList.Count > 0) { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = removeSDKZControlList }); } _Repository.DeleteUserRoleByAnalysisModelId(analysisModelId); _Repository.AddJC_RegionOutageConfigList(_jC_RegionOutageConfig.ToList()); }); if (Basic.Framework.Data.PlatRuntime.Items.ContainsKey(DataContract.UserRoleAuthorize.KeyConst.RegionOutageChangedKey)) { Basic.Framework.Data.PlatRuntime.Items[DataContract.UserRoleAuthorize.KeyConst.RegionOutageChangedKey] = DateTime.Now; } else { Basic.Framework.Data.PlatRuntime.Items.Add(DataContract.UserRoleAuthorize.KeyConst.RegionOutageChangedKey, DateTime.Now); } var jC_RegionOutageConfig = new BasicResponse <List <JC_RegionOutageConfigInfo> >(); jC_RegionOutageConfig.Data = jC_RegionOutageConfigListAddRequest.JC_RegionOutageConfigInfoList; return(jC_RegionOutageConfig); }
/// <summary> /// 删除分析模型 /// </summary> /// <param name="jc_LargedataAnalysisConfigRsequest">删除分析模型的请求对象</param> /// <returns>Mas应答对象</returns> public BasicResponse DeleteLargeDataAnalysisConfig(LargedataAnalysisConfigDeleteRequest jc_LargedataAnalysisConfigRsequest) { var jC_Largedataanalysisconfigresponse = new BasicResponse(); try { //检查, 报警,控制,应急联动配置 BasicResponse <bool> hasAlarmNotificationResponse = _AlarmNotificationPersonnelConfigService.HasAlarmNotificationForAnalysisModel(new Sys.Safety.Request.AlarmNotificationPersonnelConfig.GetAlarmNotificationByAnalysisModelIdRequest() { AnalysisModelId = jc_LargedataAnalysisConfigRsequest.Id }); if (hasAlarmNotificationResponse.IsSuccess && hasAlarmNotificationResponse.Data) { return(new BasicResponse() { Code = -100, Message = "此分析模型存在报警配置信息, 请先删除报警配置然后再删除此模型." }); } BasicResponse <bool> hasRegionOutageResponse = _RegionOutageConfigService.HasRegionOutageForAnalysisModel(new Sys.Safety.Request.RegionOutageConfig.GetByAnalysisModelIdRequest() { AnalysisModelId = jc_LargedataAnalysisConfigRsequest.Id }); if (hasRegionOutageResponse.IsSuccess && hasRegionOutageResponse.Data) { return(new BasicResponse() { Code = -100, Message = "此分析模型存在区域断电配置信息, 请先删除区域断电配置然后再删除此模型." }); } //删除分析模型 _Repository.DeleteJC_Largedataanalysisconfig(jc_LargedataAnalysisConfigRsequest.Id); BasicResponse <JC_LargedataAnalysisConfigInfo> cachedLargedataAnalysisConfigInfo = _LargeDataAnalysisConfigCacheService.GetLargeDataAnalysisConfigCacheByKey(new Sys.Safety.Request.Cache.LargeDataAnalysisConfigCacheGetByKeyRequest() { Id = jc_LargedataAnalysisConfigRsequest.Id }); if (cachedLargedataAnalysisConfigInfo != null && cachedLargedataAnalysisConfigInfo.Data != null) { try { //删除分析模型时,关闭和模型有关的未关闭的报警处理信息. alarmHandleService.CloseUnclosedAlarmHandleByAnalysisModelId(new AlarmHandleGetByAnalysisModelIdRequest() { AnalysisModelId = cachedLargedataAnalysisConfigInfo.Data.Id }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("删除分析模型时,关闭和模型有关的未关闭的报警处理信息出错. 错误消息:{0}", ex.StackTrace)); } try { //删除分析模型时,解除和模型有关的控制 BasicResponse <List <Jc_JcsdkzInfo> > analysisZKResponse = manualCrossControlService.GetManualCrossControlByTypeZkPoint(new ManualCrossControlGetByTypeZkPointRequest() { ZkPoint = cachedLargedataAnalysisConfigInfo.Data.Id, Type = (short)Enums.ControlType.LargeDataAnalyticsAreaPowerOff }); if (analysisZKResponse != null && analysisZKResponse.Data != null && analysisZKResponse.Data.Count > 0) { manualCrossControlService.DeleteManualCrossControls(new ManualCrossControlsRequest() { ManualCrossControlInfos = analysisZKResponse.Data }); } } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("删除分析模型时,解除和模型有关的控制出错. 错误消息:{0}", ex.StackTrace)); } try { //删除缓存 _LargeDataAnalysisConfigCacheService.DeleteLargeDataAnalysisConfigCache(new LargeDataAnalysisConfigCacheDeleteRequest() { LargeDataAnalysisConfigInfo = cachedLargedataAnalysisConfigInfo.Data }); } catch (Exception ex) { Basic.Framework.Logging.LogHelper.Error(string.Format("删除分析模型后再删除缓存出错:{0}", ex.StackTrace)); } } if (Basic.Framework.Data.PlatRuntime.Items.ContainsKey(DataContract.UserRoleAuthorize.KeyConst.AnalysisModelChangedKey)) { Basic.Framework.Data.PlatRuntime.Items[DataContract.UserRoleAuthorize.KeyConst.AnalysisModelChangedKey] = DateTime.Now; } else { Basic.Framework.Data.PlatRuntime.Items.Add(DataContract.UserRoleAuthorize.KeyConst.AnalysisModelChangedKey, DateTime.Now); } } catch (Exception ex) { jC_Largedataanalysisconfigresponse.Code = 2; jC_Largedataanalysisconfigresponse.Message = ex.Message; } return(jC_Largedataanalysisconfigresponse); }