lixiaojun
2022-08-17 a588775f608b2f96fb2ff80462494305af169c93
能流接口修改
已删除1个文件
已重命名1个文件
已修改2个文件
已添加1个文件
278 ■■■■ 文件已修改
Application/IStation.Application4Run/energy_flow/EngineFlow_Controller.cs 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Application/IStation.Application4Run/energy_flow/dto/EnergyFlowLogicalTreeItemDto.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Application/IStation.Application4Run/logic_month_statistics/LogicMonthStatistics_Controller.cs 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Entry/IStation.WebApi.Entry/IStation.WebApi.Entry.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Entry/IStation.WebApi.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Application/IStation.Application4Run/energy_flow/EngineFlow_Controller.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,121 @@
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Net.Http.Headers;
using Microsoft.Extensions.Hosting.Internal;
using Microsoft.AspNetCore.Http.Extensions;
using IStation.Untity;
using Furion.DynamicApiController;
using System.ComponentModel.DataAnnotations;
using Mapster;
using IStation.Calculation;
using IStation.Model;
namespace IStation.Application
{
    /// <summary>
    /// EnergyFlow
    /// </summary>
    [Route("Run/Energy/Flow")]
    [ApiDescriptionSettings("Run", Name = "能流", Order = 299)]
    public class EngineFlow_Controller : IDynamicApiController
    {
        /// <summary>
        /// é€šè¿‡ LogicTreeID èŽ·å–æŸæœˆçš„èƒ½æµè®°å½•
        /// </summary>
        [Route("GetByLogicTreeIDOfMonth@V1.0")]
        [HttpGet]
        public EnergyFlowLogicalTreeItemDto GetByLogicTreeIDOfMonth
            (
                long CorpID,
                long LogicTreeID,
                int Year,
                int Month
            )
        {
            var cacheKey = $"Run_Energy_Flow_GetByLogicTreeIDOfMonth_{CorpID}_{LogicTreeID}";
            var vm_list = MemoryCacheHelper.GetSet(cacheKey, () =>
            {
                var logicTreeList = new Service.LogicTree().GetExChildAndSelfByID(CorpID,LogicTreeID);
                if (logicTreeList == null || logicTreeList.Count < 1)
                    return default;
                #region ç»Ÿè®¡
                var vmList = new List<EnergyFlowLogicalTreeItemDto>();
                foreach (var logicTree in logicTreeList)
                {
                    var vm = new EnergyFlowLogicalTreeItemDto();
                    vm.ID = $"{IStation.ObjectType.LogicTree}_{logicTree.ID}";
                    vm.ParentID = $"{IStation.ObjectType.LogicTree}_{TreeParentIdsHelper.GetLastParentID(logicTree.ParentIds)}";
                    vm.LogicalName = logicTree.LogicName;
                    vm.LogicalType = logicTree.LogicType;
                    vm.LogicalID = logicTree.LogicID;
                    vm.StatisticValue = null;
                    vm.Children = new List<EnergyFlowLogicalTreeItemDto>();
                    vmList.Add(vm);
                    if (vm.LogicalType == IStation.ObjectType.Station)
                    {
                        var enginePumpPipeList = new Service.PipeLine().GetEnginePumpListByBelongTypeAndBelongID(CorpID, logicTree.LogicType, logicTree.LogicID);
                        if (enginePumpPipeList != null && enginePumpPipeList.Count > 0)
                        {
                            foreach (var enginePumpPipe in enginePumpPipeList)
                            {
                                var vmEnginePump = new EnergyFlowLogicalTreeItemDto();
                                vmEnginePump.ID = $"{IStation.ObjectType.PipeLine}_{enginePumpPipe.ID}";
                                vmEnginePump.ParentID = vm.ID;
                                vmEnginePump.LogicalName = enginePumpPipe.Name;
                                vmEnginePump.LogicalType = IStation.ObjectType.PipeLine;
                                vmEnginePump.LogicalID = enginePumpPipe.ID;
                                vmEnginePump.StatisticValue = new Random().Next(100, 1000);
                                vmEnginePump.Children = new List<EnergyFlowLogicalTreeItemDto>();
                                vm.Children.Add(vmEnginePump);
                            }
                        }
                    }
                    var vmParent = vmList.Find(x => x.ID == vm.ParentID);
                    if (vmParent != null)
                    {
                        vmParent.Children.Add(vm);
                    }
                }
                logicTreeList.Reverse();
                foreach (var logicTree in logicTreeList)
                {
                    var vm = vmList.Find(x => x.ID == $"{IStation.ObjectType.LogicTree}_{logicTree.ID}");
                    if (vm.Children.Count > 0)
                    {
                        var validChildren = vm.Children.Where(x => x.StatisticValue.HasValue).ToList();
                        if (validChildren.Count > 0)
                        {
                            vm.StatisticValue = validChildren.Sum(x => x.StatisticValue.Value);
                        }
                    }
                }
                #endregion
                return vmList.Find(x=>x.ID== $"{IStation.ObjectType.LogicTree}_{LogicTreeID}");
            }, CacheHelper.CacheLevel2);
            return vm_list;
        }
    }
}
Application/IStation.Application4Run/energy_flow/dto/EnergyFlowLogicalTreeItemDto.cs
ÎļþÃû´Ó Application/IStation.Application4Run/logic_month_statistics/dto/LogicMonthStatisticsLogicalTreeItemDto.cs ÐÞ¸Ä
@@ -7,9 +7,9 @@
namespace IStation.Application
{
    /// <summary>
    /// ä¸šåŠ¡æœˆç»Ÿè®¡é€»è¾‘æ ‘é¡¹Dto
    /// èƒ½æµé€»è¾‘树项Dto
    /// </summary>
    public class LogicMonthStatisticsLogicalTreeItemDto
    public class EnergyFlowLogicalTreeItemDto
    {
        /// <summary>
@@ -45,7 +45,7 @@
        /// <summary>
        /// å­é¡¹åˆ—表
        /// </summary>
        public List<LogicMonthStatisticsLogicalTreeItemDto> Children { get; set; }
        public List<EnergyFlowLogicalTreeItemDto> Children { get; set; }
    }
}
Application/IStation.Application4Run/logic_month_statistics/LogicMonthStatistics_Controller.cs
ÎļþÒÑɾ³ý
Entry/IStation.WebApi.Entry/IStation.WebApi.Entry.csproj.user
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <NameOfLastUsedPublishProfile>D:\WorkData\IStation\IStationV4.1\Core\Service.V4.1\Entry\IStation.WebApi.Entry\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\WorkData\git\istation\webapi\v4\Entry\IStation.WebApi.Entry\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
    <ActiveDebugProfile>IIS Express</ActiveDebugProfile>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Entry/IStation.WebApi.Entry/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -4,7 +4,7 @@
-->
<Project>
  <PropertyGroup>
    <_PublishTargetUrl>D:\WorkData\IStation\IStationV4.1\Core\Service.V4.1\Entry\IStation.WebApi.Entry\bin\Release\net6.0\publish\</_PublishTargetUrl>
    <History>True|2022-08-15T05:35:48.4976973Z;True|2022-08-15T13:35:34.4046702+08:00;True|2022-08-15T13:31:44.3380038+08:00;True|2022-08-15T13:07:03.2183172+08:00;True|2022-07-25T15:14:36.3659352+08:00;True|2022-07-25T15:10:01.3426246+08:00;True|2022-07-25T13:20:08.1574461+08:00;True|2022-07-19T10:26:17.1257582+08:00;True|2022-07-14T10:30:13.1942620+08:00;True|2022-07-13T14:35:30.0524912+08:00;True|2022-07-08T14:32:42.4327635+08:00;True|2022-07-05T11:08:07.0982998+08:00;True|2022-07-04T10:33:11.4756479+08:00;True|2022-07-01T22:05:04.4907981+08:00;True|2022-07-01T15:57:41.6399584+08:00;True|2022-06-29T10:33:01.2518877+08:00;True|2022-06-29T09:35:04.8176716+08:00;True|2022-06-22T10:29:08.8189250+08:00;True|2022-06-21T20:20:26.7306581+08:00;True|2022-06-21T09:54:59.2174617+08:00;True|2022-06-20T16:05:34.5414017+08:00;True|2022-06-16T13:17:09.9717924+08:00;True|2022-06-16T09:40:45.1175998+08:00;True|2022-06-15T18:01:54.0267150+08:00;False|2022-06-15T18:00:46.8407587+08:00;True|2022-06-15T15:22:18.3048191+08:00;True|2022-06-15T14:10:37.0479735+08:00;False|2022-06-15T14:08:52.7287625+08:00;True|2022-06-15T11:52:36.3090013+08:00;True|2022-06-15T10:29:17.8467709+08:00;True|2022-06-15T09:53:07.0983926+08:00;False|2022-06-15T09:51:02.1269263+08:00;True|2022-06-14T16:42:04.7964854+08:00;True|2022-06-14T14:08:49.4227432+08:00;True|2022-06-14T14:04:00.9153594+08:00;True|2022-06-13T14:57:09.1986107+08:00;True|2022-06-12T10:12:40.2143903+08:00;True|2022-06-12T09:59:01.3527438+08:00;True|2022-06-09T17:47:54.0302121+08:00;True|2022-06-09T17:30:21.7998171+08:00;True|2022-06-09T13:53:49.3251173+08:00;True|2022-06-09T11:06:42.0691794+08:00;True|2022-06-09T10:24:37.1232972+08:00;True|2022-06-09T10:00:30.4180885+08:00;True|2022-06-08T16:55:14.5816280+08:00;True|2022-06-08T16:02:29.3874857+08:00;True|2022-06-08T13:37:33.4098629+08:00;True|2022-06-08T11:05:09.3848401+08:00;True|2022-06-08T10:21:11.6630897+08:00;True|2022-06-08T09:38:48.6605705+08:00;True|2022-06-08T09:38:12.5509843+08:00;True|2022-06-08T09:37:38.2420697+08:00;True|2022-06-08T09:33:06.1943764+08:00;True|2022-06-07T17:26:45.0216506+08:00;True|2022-06-07T17:15:13.6540984+08:00;True|2022-06-07T13:30:54.6796254+08:00;True|2022-06-06T17:33:50.9010674+08:00;True|2022-06-06T17:32:21.9276179+08:00;True|2022-06-06T15:59:31.7116819+08:00;True|2022-06-06T15:29:18.4459191+08:00;True|2022-06-06T14:17:56.0946686+08:00;True|2022-06-02T09:13:02.9635258+08:00;True|2022-06-01T17:15:47.4170975+08:00;True|2022-06-01T14:06:29.6241464+08:00;True|2022-06-01T13:27:18.8319582+08:00;True|2022-06-01T13:14:07.7862232+08:00;True|2022-06-01T09:48:16.4577267+08:00;True|2022-05-30T09:57:00.6017913+08:00;True|2022-05-28T15:54:16.3134700+08:00;True|2022-05-28T11:46:55.8201686+08:00;True|2022-05-28T00:40:34.8169520+08:00;True|2022-05-27T20:45:57.0931886+08:00;True|2022-05-27T20:45:18.6248676+08:00;True|2022-05-27T14:19:14.0927561+08:00;True|2022-05-26T16:52:59.8936895+08:00;True|2022-05-26T13:53:53.4391535+08:00;True|2022-05-25T14:49:54.5116623+08:00;True|2022-05-25T14:23:38.7752497+08:00;True|2022-05-18T00:26:56.5524482+08:00;True|2022-05-17T12:08:45.5933704+08:00;True|2022-05-17T02:14:04.9500075+08:00;True|2022-05-16T12:01:40.6872993+08:00;True|2022-05-12T10:27:07.2614929+08:00;True|2022-05-11T11:02:55.5830630+08:00;True|2022-05-11T10:00:40.6549316+08:00;True|2022-05-11T09:20:32.0973524+08:00;</History>
    <_PublishTargetUrl>D:\WorkData\git\istation\webapi\v4\Entry\IStation.WebApi.Entry\bin\Release\net6.0\publish\</_PublishTargetUrl>
    <History>True|2022-08-17T08:04:30.4487827Z;True|2022-08-15T13:35:48.4976973+08:00;True|2022-08-15T13:35:34.4046702+08:00;True|2022-08-15T13:31:44.3380038+08:00;True|2022-08-15T13:07:03.2183172+08:00;True|2022-07-25T15:14:36.3659352+08:00;True|2022-07-25T15:10:01.3426246+08:00;True|2022-07-25T13:20:08.1574461+08:00;True|2022-07-19T10:26:17.1257582+08:00;True|2022-07-14T10:30:13.1942620+08:00;True|2022-07-13T14:35:30.0524912+08:00;True|2022-07-08T14:32:42.4327635+08:00;True|2022-07-05T11:08:07.0982998+08:00;True|2022-07-04T10:33:11.4756479+08:00;True|2022-07-01T22:05:04.4907981+08:00;True|2022-07-01T15:57:41.6399584+08:00;True|2022-06-29T10:33:01.2518877+08:00;True|2022-06-29T09:35:04.8176716+08:00;True|2022-06-22T10:29:08.8189250+08:00;True|2022-06-21T20:20:26.7306581+08:00;True|2022-06-21T09:54:59.2174617+08:00;True|2022-06-20T16:05:34.5414017+08:00;True|2022-06-16T13:17:09.9717924+08:00;True|2022-06-16T09:40:45.1175998+08:00;True|2022-06-15T18:01:54.0267150+08:00;False|2022-06-15T18:00:46.8407587+08:00;True|2022-06-15T15:22:18.3048191+08:00;True|2022-06-15T14:10:37.0479735+08:00;False|2022-06-15T14:08:52.7287625+08:00;True|2022-06-15T11:52:36.3090013+08:00;True|2022-06-15T10:29:17.8467709+08:00;True|2022-06-15T09:53:07.0983926+08:00;False|2022-06-15T09:51:02.1269263+08:00;True|2022-06-14T16:42:04.7964854+08:00;True|2022-06-14T14:08:49.4227432+08:00;True|2022-06-14T14:04:00.9153594+08:00;True|2022-06-13T14:57:09.1986107+08:00;True|2022-06-12T10:12:40.2143903+08:00;True|2022-06-12T09:59:01.3527438+08:00;True|2022-06-09T17:47:54.0302121+08:00;True|2022-06-09T17:30:21.7998171+08:00;True|2022-06-09T13:53:49.3251173+08:00;True|2022-06-09T11:06:42.0691794+08:00;True|2022-06-09T10:24:37.1232972+08:00;True|2022-06-09T10:00:30.4180885+08:00;True|2022-06-08T16:55:14.5816280+08:00;True|2022-06-08T16:02:29.3874857+08:00;True|2022-06-08T13:37:33.4098629+08:00;True|2022-06-08T11:05:09.3848401+08:00;True|2022-06-08T10:21:11.6630897+08:00;True|2022-06-08T09:38:48.6605705+08:00;True|2022-06-08T09:38:12.5509843+08:00;True|2022-06-08T09:37:38.2420697+08:00;True|2022-06-08T09:33:06.1943764+08:00;True|2022-06-07T17:26:45.0216506+08:00;True|2022-06-07T17:15:13.6540984+08:00;True|2022-06-07T13:30:54.6796254+08:00;True|2022-06-06T17:33:50.9010674+08:00;True|2022-06-06T17:32:21.9276179+08:00;True|2022-06-06T15:59:31.7116819+08:00;True|2022-06-06T15:29:18.4459191+08:00;True|2022-06-06T14:17:56.0946686+08:00;True|2022-06-02T09:13:02.9635258+08:00;True|2022-06-01T17:15:47.4170975+08:00;True|2022-06-01T14:06:29.6241464+08:00;True|2022-06-01T13:27:18.8319582+08:00;True|2022-06-01T13:14:07.7862232+08:00;True|2022-06-01T09:48:16.4577267+08:00;True|2022-05-30T09:57:00.6017913+08:00;True|2022-05-28T15:54:16.3134700+08:00;True|2022-05-28T11:46:55.8201686+08:00;True|2022-05-28T00:40:34.8169520+08:00;True|2022-05-27T20:45:57.0931886+08:00;True|2022-05-27T20:45:18.6248676+08:00;True|2022-05-27T14:19:14.0927561+08:00;True|2022-05-26T16:52:59.8936895+08:00;True|2022-05-26T13:53:53.4391535+08:00;True|2022-05-25T14:49:54.5116623+08:00;True|2022-05-25T14:23:38.7752497+08:00;True|2022-05-18T00:26:56.5524482+08:00;True|2022-05-17T12:08:45.5933704+08:00;True|2022-05-17T02:14:04.9500075+08:00;True|2022-05-16T12:01:40.6872993+08:00;True|2022-05-12T10:27:07.2614929+08:00;True|2022-05-11T11:02:55.5830630+08:00;True|2022-05-11T10:00:40.6549316+08:00;True|2022-05-11T09:20:32.0973524+08:00;</History>
  </PropertyGroup>
</Project>