From 2fad16e5e6f5f514d87680c522637305291fde36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E7=9D=BFAMD7950X?= <774114798@qq.com> Date: Mon, 9 Dec 2024 17:31:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E7=AB=99=E7=BD=91=E5=85=B31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OMSGAbpModule.cs | 24 +++++++++ .../ProtectionDeviceAppService.cs | 34 ++++++------ .../IProtectionSettingAppService.cs | 3 ++ .../ProtectionSettingAppService.cs | 52 ++++++++++++++++++- .../YunDa.ISAS.Application.xml | 12 +++++ .../ProtectionDeviceHistory.cs | 5 ++ 6 files changed, 113 insertions(+), 17 deletions(-) create mode 100644 OperationsMainSiteGatewayServer/OMSGAbpModule.cs diff --git a/OperationsMainSiteGatewayServer/OMSGAbpModule.cs b/OperationsMainSiteGatewayServer/OMSGAbpModule.cs new file mode 100644 index 0000000..032ed0d --- /dev/null +++ b/OperationsMainSiteGatewayServer/OMSGAbpModule.cs @@ -0,0 +1,24 @@ +using Abp.Modules; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using YunDa.ISAS.Application.Core; + +namespace Yunda.SOMS.OperationsMainSiteGatewayServer +{ + + [DependsOn(typeof(ISASApplicationCoreModule))] // 依赖 Autofac 模块 + public class OMSGAbpModule : AbpModule + { + public override void PreInitialize() + { + } + + public override void Initialize() + { + } + + } +} diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs index ea4f318..d445caa 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionDevice/ProtectionDeviceAppService.cs @@ -575,6 +575,7 @@ namespace YunDa.ISAS.Application.GeneralInformation RequestResult rst = new RequestResult(); try { + ProtectionDeviceInfo protectionDeviceInfo = null; using (var work = _unitOfWorkManager.Begin()) @@ -600,22 +601,25 @@ namespace YunDa.ISAS.Application.GeneralInformation device = _imProtectDeviceRepository.GetAllIncluding(t => t.StatCodeNavigation, t => t.GateWay).FirstOrDefault(t=>t.Id == protectionDeviceInfo.ISMS_DeviceId); await work.CompleteAsync(); } - var deviceCommInfo = new ProtectionDeviceCommInfoOutput + if (device!=null) { - DeviceAddr = device.DeviceAddr, - DeviceName = device.DeviceName, - GatewayIP1 = device.GateWay.GatewayIp1, - GatewayIP2 = device.GateWay.GatewayIp2, - GatewayIP3 = "", - MaskEth1 = "", - MaskEth2 = "", - MaskEth3 = "", - Gateway = "t192.168.61.1", - Sntp1 = "192.168.61.99", - Sntp2 = "192.168.61.99" - }; - - rst.ResultData = deviceCommInfo; + var deviceCommInfo = new ProtectionDeviceCommInfoOutput + { + DeviceAddr = device.DeviceAddr, + DeviceName = device.DeviceName, + GatewayIP1 = device.GateWay.GatewayIp1, + GatewayIP2 = device.GateWay.GatewayIp2, + GatewayIP3 = "", + MaskEth1 = "", + MaskEth2 = "", + MaskEth3 = "", + Gateway = "t192.168.61.1", + Sntp1 = "192.168.61.99", + Sntp2 = "192.168.61.99" + }; + + rst.ResultData = deviceCommInfo; + } rst.Flag = true; } catch (Exception ex) diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/IProtectionSettingAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/IProtectionSettingAppService.cs index bae8989..904ba88 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/IProtectionSettingAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/IProtectionSettingAppService.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using YunDa.ISAS.Application.Core; using YunDa.ISAS.DataTransferObject; +using YunDa.ISMS.BASE.Entities.Models; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.SearchCondition; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto; @@ -25,5 +26,7 @@ namespace YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo /// /// RequestResult> GetDzByDeviceAddr(int deviceAddr, int cpuIndex); + Task>> GetDeviceSettingEnumPu(); + Task>> GetDeviceSettingType(); } } \ No newline at end of file diff --git a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/ProtectionSettingAppService.cs b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/ProtectionSettingAppService.cs index 20b5908..a201310 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/ProtectionSettingAppService.cs +++ b/src/YunDa.Application/YunDa.ISAS.Application/GeneralInformation/ProtectionSettingInfo/ProtectionSettingAppService.cs @@ -174,12 +174,12 @@ namespace YunDa.ISAS.Application.GeneralInformation.ProtectionSettingInfo { var list = await _imDeviceDzRedis.HashSetGetAllAsync($"DZ_{entity.DeviceAddress.ToString("X2")}_System"); - rst.ResultData = list.OrderBy(t=>t.DzIndex).ToList(); + rst.ResultData = list?.OrderBy(t=>t.DzIndex)?.ToList(); } else { var list = await _imDeviceDzRedis.HashSetGetAllAsync($"DZ_{entity.DeviceAddress.ToString("X2")}_User"); - rst.ResultData = list.OrderBy(t => t.DzIndex).ToList(); + rst.ResultData = list?.OrderBy(t => t.DzIndex)?.ToList(); } rst.Flag = true; @@ -422,5 +422,53 @@ namespace YunDa.ISAS.Application.GeneralInformation.ProtectionSettingInfo Value = (new Random().Next(0, 10)).ToString() // 随机值 }).ToList(); } + /// + /// 获取定值枚举数组 + /// + /// + [ShowApi] + [AbpAllowAnonymous] + [HttpGet] + public async Task>> GetDeviceSettingEnumPu() + { + RequestResult> rst = new(); + try + { + var repo =await _imDeviceDzenumPuitory.GetAllAsync(); + rst.ResultData = repo.ToList(); + rst.Flag = true; + } + catch (Exception ex) + { + rst.Message = ex.Message; + } + return rst; + + } + /// + /// 获取定值类型 + /// + /// + [ShowApi] + [AbpAllowAnonymous] + [HttpGet] + public async Task>> GetDeviceSettingType() + { + RequestResult> rst = new(); + try + { + var repo = await _imDztypeRepository.GetAllAsync(); + rst.ResultData = repo.ToList(); + rst.Flag = true; + } + catch (Exception ex) + { + rst.Message = ex.Message; + + + } + return rst; + + } } } diff --git a/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml b/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml index 9c1b775..0f536d4 100644 --- a/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml +++ b/src/YunDa.Application/YunDa.ISAS.Application/YunDa.ISAS.Application.xml @@ -3785,6 +3785,18 @@ + + + 获取定值枚举数组 + + + + + + 获取定值类型 + + + 获取变电所结构树 diff --git a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/ProtectionDeviceHistory.cs b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/ProtectionDeviceHistory.cs index ebed26d..2ea03df 100644 --- a/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/ProtectionDeviceHistory.cs +++ b/src/YunDa.Domain/YunDa.ISAS.Entities/GeneralInformation/ProtectionDeviceHistory.cs @@ -45,5 +45,10 @@ namespace YunDa.SOMS.Entities.GeneralInformation /// 更换后数据 /// public virtual string ContentNewJson { get; set; } + /// + /// 是否已经发送给主站 + /// + public virtual bool IsSend { get; set; } + } }