| | |
| | | #region 数据 |
| | | |
| | | var eta_standard_coal = new Service.ParasConfigure().GetByType(corpId, Configure.Paras_StandardCoal);//标准煤系数 |
| | | |
| | | var eta_standard_list = new Service.EtaStandardConfigure().GetByCorpID(corpId);//能效标准项列表 |
| | | |
| | | |
| | | var service_eta = new Service.EtaLogicRealRecord(); |
| | | var eta_yestoday_record_list = service_eta.GetByObjectOfDay(corpId, ObjectType.LogicArea, logicAreaId, DateTime.Today.AddDays(-1)); //昨天的所有能效记录 |
| | |
| | | var eta_sum_month_this_record_list = service_eta_sum.GetMonthByObjectOfYear(corpId, ObjectType.LogicArea, logicAreaId, this_year);//今年的能效月汇总记录 |
| | | var eta_sum_day_last_record_list = service_eta_sum.GetDayByObjectOfYM(corpId, ObjectType.LogicArea, logicAreaId, last_month_day.Year, last_month_day.Month);//上月的能效日汇总记录 |
| | | var eta_sum_day_this_record_list = service_eta_sum.GetDayByObjectOfYM(corpId, ObjectType.LogicArea, logicAreaId, today.Year, today.Month);//当月的能效日汇总记录 |
| | | |
| | | #endregion |
| | | |
| | | var vm = new EtaKpi(); |
| | |
| | | standard_coal = double.Parse(eta_standard_coal.Value); |
| | | } |
| | | var run_coal = eta_pa_record_list.Sum(x => x.Pa.Value * x.Duration / 3600f); |
| | | vm_item_coal.Value = ((run_coal / 10000f) * standard_coal).ToString("0.0000"); |
| | | var run_coalStandard = ((run_coal / 10000f) * standard_coal); |
| | | if (run_coalStandard > 1) |
| | | { |
| | | vm_item_coal.Value = run_coalStandard.ToString("0.00"); |
| | | } |
| | | else |
| | | { |
| | | vm_item_coal.Value = run_coalStandard.ToString("0.0000"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | vm.RatioItems = new List<EtaKpiRatioItem>(); |
| | | if (eta_this_record_list != null && eta_this_record_list.Count > 0) |
| | | { |
| | | var eta_this_ea_record_list = eta_this_record_list.Where(x => x.Ea != null).ToList(); |
| | | var eta_this_ea_record_list = eta_this_record_list.Where(x => x.Ea != null).ToList(); |
| | | if (eta_this_ea_record_list != null && eta_this_ea_record_list.Count > 0) |
| | | { |
| | | if (eta_standard_list != null && eta_standard_list.Count > 0) |
| | |
| | | month_item_ws.ThisMonthRecords.Add(record); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | |
| | | |
| | | #endregion |
| | | |
| | | return vm; |
| | | #region 错误信息 |
| | | if (eta_last_record != null) |
| | | { |
| | | var stationIds = eta_last_record.GetStatioinIds(); |
| | | if (stationIds != null && stationIds.Count > 0) |
| | | { |
| | | if (!string.IsNullOrEmpty(eta_last_record.AnalyInfo)) |
| | | { |
| | | var stations = new Service.Station().GetByIds(corpId, stationIds); |
| | | foreach (var item in stations) |
| | | { |
| | | vm.ErrorMessage += item.Name + "/"; |
| | | } |
| | | vm.ErrorMessage = vm.ErrorMessage.Substring(0, vm.ErrorMessage.Length - 1) + "测点异常!"; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 备注信息 |
| | | var logicArea = new Service.LogicArea().GetByID(corpId, logicAreaId); |
| | | vm.Description = logicArea.Description; |
| | | #endregion |
| | | return vm; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | var eta_this_run_record_list = eta_this_record_list?.Where(x => x.RunningCount > 0).ToList();//当天所有开机能效记录 |
| | | var eta_last_record = eta_this_record_list?.LastOrDefault();//最近一次能效记录 |
| | | |
| | | |
| | | |
| | | var service_eta_sum = new Service.EtaSumMultiRecord(); |
| | | var eta_sum_month_last_record_list = service_eta_sum.GetMonthByObjectOfYear(corpId,ObjectType.Station, stationId, last_year);//去年的能效月汇总记录 |
| | | var eta_sum_month_this_record_list = service_eta_sum.GetMonthByObjectOfYear(corpId, ObjectType.Station, stationId, this_year);//今年的能效月汇总记录 |
| | |
| | | |
| | | #endregion |
| | | |
| | | var vm = new EtaKpi(); |
| | | |
| | | var vm = new EtaKpi(); |
| | | |
| | | #region Kpi指标项 |
| | | |
| | |
| | | standard_coal = double.Parse(eta_standard_coal.Value); |
| | | } |
| | | var run_coal = eta_run_pa_record_list.Sum(x => x.Pa.Value * x.Duration / 3600f); |
| | | vm_item_coal.Value = ((run_coal / 10000f) * standard_coal).ToString("0.0000"); |
| | | var run_coalStandard = ((run_coal / 10000f) * standard_coal); |
| | | if (run_coalStandard > 1) |
| | | { |
| | | vm_item_coal.Value = run_coalStandard.ToString("0.00"); |
| | | } |
| | | else |
| | | { |
| | | vm_item_coal.Value = run_coalStandard.ToString("0.0000"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 错误信息 |
| | | if (eta_last_record != null) |
| | | { |
| | | if (!string.IsNullOrEmpty(eta_last_record.AnalyInfo)) |
| | | { |
| | | vm.ErrorMessage += eta_last_record.GetAnaInfoCN(); |
| | | var pumpIds = eta_last_record.GetPumpIds(); |
| | | if (pumpIds != null && pumpIds.Count > 0) |
| | | { |
| | | var pumps = new Service.Product().GetByIds(corpId, pumpIds); |
| | | foreach (var item in pumps) |
| | | { |
| | | vm.ErrorMessage += item.Name + "/"; |
| | | } |
| | | vm.ErrorMessage = vm.ErrorMessage.Substring(0, vm.ErrorMessage.Length - 1) + "测点异常!"; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region 备注信息 |
| | | var station = new Service.LogicArea().GetByID(corpId, stationId); |
| | | vm.Description = station.Description; |
| | | #endregion |
| | | |
| | | return vm; |
| | | } |
| | | |
| | |
| | | #region 数据 |
| | | |
| | | var eta_standard_coal = new Service.ParasConfigure().GetByType(corpId,Configure.Paras_StandardCoal);//标准煤系数 |
| | | LogHelper.Info("标准煤系数 通过"); |
| | | |
| | | var eta_standard_list = new Service.EtaStandardConfigure().GetByCorpID(corpId);//能效标准项列表 |
| | | LogHelper.Info("能效标准项列表 通过"); |
| | | |
| | | var service_eta = new Service.EtaSingleRealRecord(); |
| | | var eta_yestoday_record_list = service_eta.GetByObjectOfDay(corpId, ObjectType.PipeLine, pipeLineId, DateTime.Today.AddDays(-1));//昨天的所有能效记录 |
| | | var eta_record_list = service_eta.GetByObjectOfDay(corpId, ObjectType.PipeLine, pipeLineId, DateTime.Today);//当天所有能效记录 |
| | | var eta_run_record_list = eta_record_list?.Where(x => x.RSa > 0).ToList();//当天所有开机能效记录 |
| | | var eta_last_record = eta_record_list?.LastOrDefault();//最近一次能效记录 |
| | | LogHelper.Info("EtaLogicRealRecord 通过"); |
| | | |
| | | var service_eta_sum = new Service.EtaSumSingleRecord(); |
| | | var eta_sum_month_last_record_list = service_eta_sum.GetMonthByObjectOfYear(corpId, ObjectType.PipeLine, pipeLineId, last_year);//去年的能效月汇总记录 |
| | | var eta_sum_month_this_record_list = service_eta_sum.GetMonthByObjectOfYear(corpId, ObjectType.PipeLine, pipeLineId, this_year);//今年的能效月汇总记录 |
| | | LogHelper.Info("EtaSumSingleMonthRecord 通过"); |
| | | var eta_sum_day_last_record_list = service_eta_sum.GetDayByObjectOfYM(corpId, ObjectType.PipeLine, pipeLineId, last_month_day.Year, last_month_day.Month);//上月的能效日汇总记录 |
| | | var eta_sum_day_this_record_list = service_eta_sum.GetDayByObjectOfYM(corpId, ObjectType.PipeLine, pipeLineId, today.Year, today.Month);//当月的能效日汇总记录 |
| | | LogHelper.Info("EtaSumSingleDayRecord 通过"); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var vm = new EtaKpi(); |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 标准煤 |
| | | #region 标准煤 |
| | | |
| | | var vm_item_coal = new EtaKpiItem(); |
| | | vm_item_coal.Name = "标准煤"; |
| | |
| | | standard_coal = double.Parse(eta_standard_coal.Value); |
| | | } |
| | | var run_coal = eta_run_pa_record_list.Sum(x => x.Pa.Value * x.Duration / 3600f); |
| | | vm_item_coal.Value = ((run_coal / 10000f) * standard_coal).ToString("0.0000"); |
| | | var run_coalStandard = ((run_coal / 10000f) * standard_coal); |
| | | if (run_coalStandard > 1) |
| | | { |
| | | vm_item_coal.Value = run_coalStandard.ToString("0.00"); |
| | | } |
| | | else |
| | | { |
| | | vm_item_coal.Value = run_coalStandard.ToString("0.0000"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 错误信息 |
| | | if (eta_last_record != null) |
| | | { |
| | | vm.ErrorMessage = eta_last_record.GetAnaInfoCN(); |
| | | } |
| | | #endregion |
| | | |
| | | #region 备注信息 |
| | | var pipeLineBinding = new Service.PipeLineBinding().GetUseByPipeLineID(corpId,pipeLineId); |
| | | if (pipeLineBinding!=null&&pipeLineBinding.Count>0) |
| | | { |
| | | var first = pipeLineBinding.First(); |
| | | var product = new Service.Product().GetByID(corpId, first.BindingID); |
| | | vm.Description = product?.Description; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | return vm; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |