| | |
| | | /// </summary> |
| | | [Route("Eta/Analy/Deviation")] |
| | | [ApiDescriptionSettings("Eta", Name = "能效偏差分析", Order = 900)] |
| | | public class EtaAnalyDeviation_Controller : IDynamicApiController |
| | | public class EtaAnalyDeviation_Controller : IDynamicApiController |
| | | { |
| | | /// <summary> |
| | | /// 通过 PipeLineID 获取某日偏差内容记录 |
| | |
| | | [HttpGet] |
| | | public List<EtaDeviationDayContent> GetContentByPipeLineIDOfDay |
| | | ( |
| | | [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")] |
| | | [Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")] |
| | | long CorpID, |
| | | [Required, Range(1, long.MaxValue, ErrorMessage = "PipeLineID 必须大于0")] |
| | | long PipeLineID, |
| | |
| | | } |
| | | |
| | | var vmList = new List<EtaDeviationDayContent>(); |
| | | var recordList = new Service.EtaSingleRealRecord().GetRunByObjectOfDay(CorpID, ObjectType.PipeLine, PipeLineID, Day) ; |
| | | recordList = recordList?.Where(x => x.AnalyStatus==Model.Eta.eAnalyStatus.Normal).ToList(); |
| | | var recordList = new Service.EtaSingleRealRecord().GetRunByObjectOfDay(CorpID, ObjectType.PipeLine, PipeLineID, Day); |
| | | recordList = recordList?.Where(x => x.AnalyStatus == Model.Eta.eAnalyStatus.Normal).ToList(); |
| | | if (recordList != null && recordList.Count > 0) |
| | | { |
| | | foreach (var record in recordList) |
| | | { |
| | | var vm = new EtaDeviationDayContent(); |
| | | vm.Time = record.DataTime.ToString("HH:mm:ss"); |
| | | vm.HZr = record.HZa;//新增字段 nsx |
| | | |
| | | vm.Qr = Math.Round(record.Qa.Value, 2); |
| | | vm.Hr = Math.Round(record.Ha.Value, 2); |
| | |
| | | |
| | | return vmList; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 时间 |
| | | /// </summary> |
| | | public string Time { get; set; } |
| | | public string Time { get; set; } |
| | | /// <summary> |
| | | /// 频率(原始) |
| | | /// </summary> |
| | | public double HZr { get; set; } |
| | | /// <summary> |
| | | /// 流量(原始) |
| | | /// </summary> |
| | |
| | | }, CacheHelper.CacheLevel3); |
| | | return vm_list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | this.OtherName = rhs.OtherName; |
| | | this.SortCode = rhs.SortCode; |
| | | this.IsWorking = rhs.IsWorking; |
| | | this.ReliabilityStatus = rhs.ReliabilityStatus; |
| | | this.PointQH = rhs.CurveInfo?.CurveQH?.GetFitPoints(20)?.Select(x=>new CurvePointDto(x.X,x.Y)).ToList(); |
| | | this.PointQP = rhs.CurveInfo?.CurveQP?.GetFitPoints(20)?.Select(x => new CurvePointDto(x.X, x.Y)).ToList(); |
| | | this.PointQE = rhs.CurveInfo?.CurveQE?.GetFitPoints(20)?.Select(x => new CurvePointDto(x.X, x.Y)).ToList(); |
| | |
| | | public bool IsWorking { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 可信度 |
| | | /// </summary> |
| | | public Model.PumpCurve.eReliabilityStatus ReliabilityStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<CurvePointDto> PointQH { get; set; } |
| | |
| | | this.OtherName = rhs.OtherName; |
| | | this.SortCode = rhs.SortCode; |
| | | this.IsWorking = rhs.IsWorking; |
| | | this.ReliabilityStatus = rhs.ReliabilityStatus; |
| | | this.PointQH = rhs.CurveInfo?.CurveQH?.GetFitPoints(20)?.Select(x => new CurvePointDto(x.X, x.Y)).ToList(); |
| | | this.PointQP = rhs.CurveInfo?.CurveQP?.GetFitPoints(20)?.Select(x => new CurvePointDto(x.X, x.Y)).ToList(); |
| | | this.PointQE = rhs.CurveInfo?.CurveQE?.GetFitPoints(20)?.Select(x => new CurvePointDto(x.X, x.Y)).ToList(); |
| | |
| | | public bool IsWorking { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 可信度 |
| | | /// </summary> |
| | | public Model.PumpCurve.eReliabilityStatus ReliabilityStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<CurvePointDto> PointQH { get; set; } |
| | |
| | | throw Oops.Oh(ErrorCodes.D002, $"测点:{monitorId}", "未配置公式参数"); |
| | | } |
| | | |
| | | var getMonitorPoint = new Func<long, Model.MonitorPoint_Signal_SignalType>(x => { |
| | | var getMonitorPoint = new Func<long, Model.MonitorPoint_Signal_SignalType>(x => |
| | | { |
| | | return new Service.MonitorPoint().GetExSignalWithSignalTypeByID(corpId, x); |
| | | }); |
| | | var getLastRecord = new Func<long, long, Model.MonitorBasicRecord>((x, y) => { |
| | | var getLastRecord = new Func<long, long, Model.MonitorBasicRecord>((x, y) => |
| | | { |
| | | return new Service.MonitorDayRecord().GetBySignalIDOfDay(corpId, x, y, startDay.AddDays(-1)); |
| | | }); |
| | | var getRecordList = new Func<long, long,Model.Monitor.eCronType, DateTime,DateTime, List<Model.MonitorBasicRecord>>((x, y,cy, st,et) => { |
| | | var getRecordList = new Func<long, long, Model.Monitor.eCronType, DateTime, DateTime, List<Model.MonitorBasicRecord>>((x, y, cy, st, et) => |
| | | { |
| | | switch (cy) |
| | | { |
| | | case Model.Monitor.eCronType.Real: |
| | | { |
| | | return new Service.MonitorRealRecord() |
| | | .GetBySignalIDOfTimeRange(corpId,x,y,st,et)?.Select(x=>x as Model.MonitorBasicRecord).ToList(); |
| | | .GetBySignalIDOfTimeRange(corpId, x, y, st, et)?.Select(x => x as Model.MonitorBasicRecord).ToList(); |
| | | } |
| | | case Model.Monitor.eCronType.EachHour: |
| | | { |
| | | return new Service.MonitorHourRecord().GetBySignalIDOfHourRange |
| | | (monitor.CorpID, x, y, st.Date, st.Hour + 1, et.AddHours(-1).Date, et.AddHours(-1).Hour + 1)?.Select(x=>x as Model.MonitorBasicRecord).ToList(); |
| | | (monitor.CorpID, x, y, st.Date, st.Hour + 1, et.AddHours(-1).Date, et.AddHours(-1).Hour + 1)?.Select(x => x as Model.MonitorBasicRecord).ToList(); |
| | | } |
| | | default:return default; |
| | | default: return default; |
| | | } |
| | | }); |
| | | |
| | | List<Model.MonitorDayRecordPure> recordList = null; |
| | | List<Model.MonitorDayRecordPure> recordList = null; |
| | | string msg = string.Empty; |
| | | switch (analyModel.FormulaType) |
| | | { |
| | |
| | | } |
| | | var bol = new Service.MonitorDayRecord().InsertsAgain(recordList); |
| | | return new AnalyAgainMonitorGeneralDayRecordOfDayRangeResultDto(bol, msg); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| | | <PropertyGroup> |
| | | <NameOfLastUsedPublishProfile>D:\WorkData\git\istation\webapi\v4\Entry\IStation.WebApi.Entry\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\WorkData\IStation\IStationV4.1\Core\Service.V4.1\Entry\IStation.WebApi.Entry\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <ActiveDebugProfile>IIS Express</ActiveDebugProfile> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
| | |
| | | public bool UpdateReliabilityStatus(long CorpID, long ID, int ReliabilityStatus, long UpdateUserID, DateTime UpdateTime) |
| | | { |
| | | if (ID < 1) |
| | | return default; |
| | | return default; |
| | | var dal = new DAL.PumpCurve(); |
| | | var bol = dal.UpdateReliabilityStatus(CorpID, ID, ReliabilityStatus, UpdateUserID, UpdateTime); |
| | | if (bol) |