public static List <JC_LargedataAnalysisConfigInfo> GetAllLargedataAnalysisConfig() { var req = new LargeDataAnalysisConfigCacheGetAllRequest(); var res = _largeDataAnalysisConfigCacheService.GetAllLargeDataAnalysisConfigCache(req); if (!res.IsSuccess) { throw new Exception(res.Message); } return(res.Data); }
public BasicResponse <List <JC_LargedataAnalysisConfigInfo> > GetAllLargeDataAnalysisConfigCache(LargeDataAnalysisConfigCacheGetAllRequest largeDataAnalysisConfigCache) { var bigDataAnalysisConfigCache = LargeDataAnalysisConfigCache.LargedataAnalysisConfigCahceInstance.Query(); var bigDataAnalysisConfigCacheResponse = new BasicResponse <List <JC_LargedataAnalysisConfigInfo> >(); bigDataAnalysisConfigCacheResponse.Data = bigDataAnalysisConfigCache; return(bigDataAnalysisConfigCacheResponse); }
public BasicResponse <List <GetSysEmergencyLinkageListAndStatisticsResponse> > GetSysEmergencyLinkageListAndStatistics(StringRequest request) { var lis = new List <GetSysEmergencyLinkageListAndStatisticsResponse>(); var req2 = new LargeDataAnalysisConfigCacheGetAllRequest(); var res2 = _largeDataAnalysisConfigCacheService.GetAllLargeDataAnalysisConfigCache(req2); var allLargeDataConfig = res2.Data; var req = new EmergencyLinkageConfigCacheGetAllRequest(); var res = _sysEmergencyLinkageCacheService.GetAllSysEmergencyLinkageCache(req); var name = request.Str; List <SysEmergencyLinkageInfo> queryData; if (string.IsNullOrEmpty(name)) { queryData = res.Data.OrderByDescending(a => a.EditTime).ToList(); } else { queryData = res.Data.Where(a => a.Name == request.Str).OrderByDescending(a => a.EditTime).ToList(); } foreach (var item in queryData) { var largeDataConfig = allLargeDataConfig.FirstOrDefault(a => a.Id == item.MasterModelId); var largeDataConfigName = largeDataConfig == null ? "" : largeDataConfig.Name; var newItem = new GetSysEmergencyLinkageListAndStatisticsResponse() { DeletePerson = item.DeletePerson, DeleteTime = item.DeleteTime.ToString("yyyy-MM-dd HH:mm:ss"), EditPerson = item.EditPerson, EditTime = item.EditTime.ToString("yyyy-MM-dd HH:mm:ss"), Id = item.Id, MasterAreaAssId = item.MasterAreaAssId, MasterAreaNum = item.MasterAreas.Count.ToString(), MasterDevTypeAssId = item.MasterDevTypeAssId, MasterDevTypeNum = item.MasterDevTypes.Count.ToString(), MasterModelName = largeDataConfigName, MasterPointAssId = item.MasterPointAssId, MasterPointNum = item.MasterPoint.Count.ToString(), MasterTriDataStateAssId = item.MasterTriDataStateAssId, MasterTriDataStateNum = item.MasterTriDataStates.Count.ToString(), PassiveAreaAssId = item.PassiveAreaAssId, PassiveAreaNum = item.PassiveAreas.Count.ToString(), PassivePersonAssId = item.PassivePersonAssId, PassivePersonNum = item.PassivePersons.Count.ToString(), PassivePointAssId = item.PassivePointAssId, PassivePointNum = item.PassivePoints.Count.ToString(), Name = item.Name, Type = item.Type, TypeName = item.Type == 1 ? "普通联动" : "大数据分析联动", Duration = item.Duration }; lis.Add(newItem); } //var name = request.Str; //var dt = _Repository.QueryTable( // "global_SysEmergencyLinkageService_GetSysEmergencyLinkageListAndStatistics", name); //foreach (DataRow item in dt.Rows) //{ // var newItem = new GetSysEmergencyLinkageListAndStatisticsResponse() // { // DeletePerson = item["DeletePerson"].ToString(), // DeleteTime = item["DeleteTimeConvert"].ToString(), // EditPerson = item["EditPerson"].ToString(), // EditTime = item["EditTime"].ToString(), // Id = item["Id"].ToString(), // MasterAreaAssId = item["MasterAreaAssId"].ToString(), // MasterAreaNum = item["MasterAreaNum"].ToString(), // MasterDevTypeAssId = item["MasterDevTypeAssId"].ToString(), // MasterDevTypeNum = item["MasterDevTypeNum"].ToString(), // MasterModelName = item["MasterModelName"] == null ? "" : item["MasterModelName"].ToString(), // MasterPointAssId = item["MasterPointAssId"].ToString(), // MasterPointNum = item["MasterPointNum"].ToString(), // MasterTriDataStateAssId = item["MasterTriDataStateAssId"].ToString(), // MasterTriDataStateNum = item["MasterTriDataStateNum"].ToString(), // PassiveAreaAssId = item["PassiveAreaAssId"].ToString(), // PassiveAreaNum = item["PassiveAreaNum"].ToString(), // PassivePersonAssId = item["PassivePersonAssId"].ToString(), // PassivePersonNum = item["PassivePersonNum"].ToString(), // PassivePointAssId = item["PassivePointAssId"].ToString(), // PassivePointNum = item["PassivePointNum"].ToString(), // Name = item["Name"].ToString(), // Type = (int)item["Type"], // TypeName = (int)item["Type"] == 1 ? "普通联动" : "大数据分析联动", // Duration = Convert.ToInt32(item["Duration"]) // }; // lis.Add(newItem); //} var ret = new BasicResponse <List <GetSysEmergencyLinkageListAndStatisticsResponse> >() { Data = lis }; return(ret); }