/// <summary> /// 删除报警推送信息 /// </summary> /// <param name="id">ID</param> /// <returns></returns> public string DeleteJC_AlarmNotificationPersonnelConfig(List <string> ids) { try { //1.模板 //调用接口 Basic.Framework.Web.BasicResponse analysisTemplateResult = alarmNotificationPersonnelConfigService.DeleteJC_AlarmNotificationPersonnelConfig( new AlarmNotificationPersonnelConfigDeleteRequest() { ids = ids }); if (analysisTemplateResult.IsSuccess == false) { return(analysisTemplateResult.Message); } else { if (analysisTemplateResult.Code != 100) { return(analysisTemplateResult.Message); } else { return("100"); } } } catch (Exception ex) { return("-100"); } }
/// <summary> /// 删除分析模板 /// </summary> /// <param name="id">模板ID</param> /// <returns></returns> public string DeleteAnalysisTemplateConfig(List <delAnalysisTemplateModel> ids) { try { //验证模板是否被使用 //分析模型配置表 //JC_LargedataAnalysisConfig //调用接口 StringBuilder returnSbError = new StringBuilder(); foreach (var item in ids) { Basic.Framework.Web.BasicResponse <List <JC_LargedataAnalysisConfigInfo> > largedataAnalysisConfigResult = largedataAnalysisConfigService.GetLargeDataAnalysisConfigListByTempleteId(new LargedataAnalysisConfigGetRequest() { TempleteId = item.id }); if (largedataAnalysisConfigResult.IsSuccess == true) { if (largedataAnalysisConfigResult.Data != null && largedataAnalysisConfigResult.Data.Count > 0) { returnSbError.Append("["); returnSbError.Append(item.name); returnSbError.Append("]"); } } else { return(largedataAnalysisConfigResult.Message); } } if (!string.IsNullOrWhiteSpace(returnSbError.ToString())) { return("模板" + returnSbError.ToString() + "已被使用,不能删除。"); } List <string> lstID = new List <string>(); foreach (var item in ids) { lstID.Add(item.id); } //1.模板 AnalysisTemplateDeleteRequest analysisTemplateDeleteRequest = new AnalysisTemplateDeleteRequest(); analysisTemplateDeleteRequest.Ids = lstID; //调用接口 Basic.Framework.Web.BasicResponse analysisTemplateResult = analysisTemplateService.DeleteJC_Analysistemplate(analysisTemplateDeleteRequest); if (analysisTemplateResult.IsSuccess == false) { return(analysisTemplateResult.Message); } else { if (analysisTemplateResult.Code != 100) { return(analysisTemplateResult.Message); } else { return("100"); } } } catch (Exception ex) { return("-100"); } }