| | |
| | | } |
| | | |
| | | return vm_list; |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | |
| | | var model = new Yw.Service.DmaArea().GetByID(input.ID); |
| | | if (model == null) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, ErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | } |
| | | var vm = new DmaAnalyAreaDetailDto(model); |
| | | |
| | |
| | | [HttpGet] |
| | | public List<DmaAnalyAreaDayStatusDto> GetAreaDayStatusList([FromQuery][Required] QueryDmaAreaDayStatusListInput input) |
| | | { |
| | | return default; |
| | | var vmList = new List<DmaAnalyAreaDayStatusDto>(); |
| | | for (DateTime i = input.StartDay.Date; i <= input.EndDay.Date; i = i.AddDays(1)) |
| | | { |
| | | var vm = new DmaAnalyAreaDayStatusDto(); |
| | | vm.Day = i; |
| | | vm.InVol = RandomHelper.Random(4000, 5000); |
| | | vm.OutVol = RandomHelper.Random(1000, 2000); |
| | | vm.ReadVol = RandomHelper.Random(2000, 3000); |
| | | vm.UseVol = vm.InVol - vm.OutVol; |
| | | vm.LeakRate = null; |
| | | vmList.Add(vm); |
| | | } |
| | | return vmList; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Route("GetAreaMonthStatusList@V1.0")] |
| | | [HttpGet] |
| | | public List<DmaAnalyAreaDayStatusDto> GetAreaMonthStatusList([FromQuery][Required] QueryDmaAreaMonthStatusListInput input) |
| | | public List<DmaAnalyAreaMonthStatusDto> GetAreaMonthStatusList([FromQuery][Required] QueryDmaAreaMonthStatusListInput input) |
| | | { |
| | | return default; |
| | | var vmList = new List<DmaAnalyAreaMonthStatusDto>(); |
| | | for (int i = input.StartYear; i <= input.EndYear; i++) |
| | | { |
| | | var min = 1; |
| | | if (i == input.StartYear) |
| | | { |
| | | min = input.StartMonth; |
| | | } |
| | | var max = 12; |
| | | if (i == input.EndYear) |
| | | { |
| | | max = input.EndMonth; |
| | | } |
| | | for (int j = min; j <= max; j++) |
| | | { |
| | | var vm = new DmaAnalyAreaMonthStatusDto(); |
| | | vm.Year = i; |
| | | vm.Month = j; |
| | | vm.InVol = RandomHelper.Random(4000, 5000); |
| | | vm.OutVol = RandomHelper.Random(1000, 2000); |
| | | vm.ReadVol = RandomHelper.Random(2000, 3000); |
| | | vm.UseVol = vm.InVol - vm.OutVol; |
| | | vm.LeakRate = null; |
| | | vmList.Add(vm); |
| | | } |
| | | |
| | | } |
| | | return vmList; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | var site = new Yw.Service.DmaSite().GetByID(input.ID); |
| | | if (site == null) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, ErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | } |
| | | var vm = new DmaAnalySiteDetailDto(site); |
| | | |
| | |
| | | var site = new Yw.Service.DmaSite().GetByID(input.ID); |
| | | if (site == null) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, ErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | } |
| | | var binding = new Yw.Service.DmaSiteBinding().GetValidBySiteID(site.ID); |
| | | if (binding == null) |
| | |
| | | [HttpGet] |
| | | public List<DmaAnalySiteDayStatusDto> GetSiteDayStatusList([FromQuery][Required] QueryDmaSiteDayStatusListInput input) |
| | | { |
| | | return default; |
| | | var vmList = new List<DmaAnalySiteDayStatusDto>(); |
| | | for (DateTime i = input.StartDay.Date; i <= input.EndDay.Date; i = i.AddDays(1)) |
| | | { |
| | | var vm = new DmaAnalySiteDayStatusDto(); |
| | | vm.Day = i; |
| | | vm.Value = RandomHelper.Random(1000, 5000); |
| | | if (vm.Value > 4000) |
| | | { |
| | | vm.Value = null; |
| | | } |
| | | vmList.Add(vm); |
| | | } |
| | | return vmList; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | [Route("GetSiteMonthStatusList@V1.0")] |
| | | [HttpGet] |
| | | public List<DmaAnalySiteDayStatusDto> GetSiteMonthStatusList([FromQuery][Required] QueryDmaSiteDayStatusListInput input) |
| | | public List<DmaAnalySiteMonthStatusDto> GetSiteMonthStatusList([FromQuery][Required] QueryDmaSiteMonthStatusListInput input) |
| | | { |
| | | return default; |
| | | var vmList = new List<DmaAnalySiteMonthStatusDto>(); |
| | | for (int i = input.StartYear; i <= input.EndYear; i++) |
| | | { |
| | | var min = 1; |
| | | if (i == input.StartYear) |
| | | { |
| | | min = input.StartMonth; |
| | | } |
| | | var max = 12; |
| | | if (i == input.EndYear) |
| | | { |
| | | max = input.EndMonth; |
| | | } |
| | | for (int j = min; j <= max; j++) |
| | | { |
| | | var vm = new DmaAnalySiteMonthStatusDto(); |
| | | vm.Year = i; |
| | | vm.Month = j; |
| | | vm.Value = RandomHelper.Random(1000, 5000); |
| | | if (vm.Value > 4000) |
| | | { |
| | | vm.Value = null; |
| | | } |
| | | vmList.Add(vm); |
| | | } |
| | | |
| | | } |
| | | return vmList; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | var catalogList = new Yw.Service.SysCatalog().GetChildAndSelfByCode(IStation.Catalog.FlowMeter); |
| | | if (catalogList == null || catalogList.Count < 1) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, ErrorCodes.V001, "流量计分类编码验证失败"); |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, "流量计分类编码验证失败"); |
| | | } |
| | | var catalogIds = catalogList.Select(x => x.ID).Distinct().ToList(); |
| | | |
| | |
| | | var catalogList = new Yw.Service.SysCatalog().GetChildAndSelfByCode(IStation.Catalog.PressMeter); |
| | | if (catalogList == null || catalogList.Count < 1) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, ErrorCodes.V001, "压力计分类编码验证失败"); |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, "压力计分类编码验证失败"); |
| | | } |
| | | var catalogIds = catalogList.Select(x => x.ID).Distinct().ToList(); |
| | | |