主站网关1

This commit is contained in:
郭睿AMD7950X 2024-12-09 17:31:46 +08:00
parent df2a417de2
commit 2fad16e5e6
6 changed files with 113 additions and 17 deletions

View File

@ -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()
{
}
}
}

View File

@ -575,6 +575,7 @@ namespace YunDa.ISAS.Application.GeneralInformation
RequestResult<ProtectionDeviceCommInfoOutput> rst = new RequestResult<ProtectionDeviceCommInfoOutput>(); RequestResult<ProtectionDeviceCommInfoOutput> rst = new RequestResult<ProtectionDeviceCommInfoOutput>();
try try
{ {
ProtectionDeviceInfo protectionDeviceInfo = null; ProtectionDeviceInfo protectionDeviceInfo = null;
using (var work = _unitOfWorkManager.Begin()) 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); device = _imProtectDeviceRepository.GetAllIncluding(t => t.StatCodeNavigation, t => t.GateWay).FirstOrDefault(t=>t.Id == protectionDeviceInfo.ISMS_DeviceId);
await work.CompleteAsync(); await work.CompleteAsync();
} }
var deviceCommInfo = new ProtectionDeviceCommInfoOutput if (device!=null)
{ {
DeviceAddr = device.DeviceAddr, var deviceCommInfo = new ProtectionDeviceCommInfoOutput
DeviceName = device.DeviceName, {
GatewayIP1 = device.GateWay.GatewayIp1, DeviceAddr = device.DeviceAddr,
GatewayIP2 = device.GateWay.GatewayIp2, DeviceName = device.DeviceName,
GatewayIP3 = "", GatewayIP1 = device.GateWay.GatewayIp1,
MaskEth1 = "", GatewayIP2 = device.GateWay.GatewayIp2,
MaskEth2 = "", GatewayIP3 = "",
MaskEth3 = "", MaskEth1 = "",
Gateway = "t192.168.61.1", MaskEth2 = "",
Sntp1 = "192.168.61.99", MaskEth3 = "",
Sntp2 = "192.168.61.99" Gateway = "t192.168.61.1",
}; Sntp1 = "192.168.61.99",
Sntp2 = "192.168.61.99"
rst.ResultData = deviceCommInfo; };
rst.ResultData = deviceCommInfo;
}
rst.Flag = true; rst.Flag = true;
} }
catch (Exception ex) catch (Exception ex)

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using YunDa.ISAS.Application.Core; using YunDa.ISAS.Application.Core;
using YunDa.ISAS.DataTransferObject; using YunDa.ISAS.DataTransferObject;
using YunDa.ISMS.BASE.Entities.Models;
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto;
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.SearchCondition; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto.SearchCondition;
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto; using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionSettingDto;
@ -25,5 +26,7 @@ namespace YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo
/// <param name="cpuIndex"></param> /// <param name="cpuIndex"></param>
/// <returns></returns> /// <returns></returns>
RequestResult<List<ImDeviceDzOutput>> GetDzByDeviceAddr(int deviceAddr, int cpuIndex); RequestResult<List<ImDeviceDzOutput>> GetDzByDeviceAddr(int deviceAddr, int cpuIndex);
Task<RequestResult<List<ImDeviceDzenumPu>>> GetDeviceSettingEnumPu();
Task<RequestResult<List<ImDztype>>> GetDeviceSettingType();
} }
} }

View File

@ -174,12 +174,12 @@ namespace YunDa.ISAS.Application.GeneralInformation.ProtectionSettingInfo
{ {
var list = await _imDeviceDzRedis.HashSetGetAllAsync($"DZ_{entity.DeviceAddress.ToString("X2")}_System"); 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 else
{ {
var list = await _imDeviceDzRedis.HashSetGetAllAsync($"DZ_{entity.DeviceAddress.ToString("X2")}_User"); 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; rst.Flag = true;
@ -422,5 +422,53 @@ namespace YunDa.ISAS.Application.GeneralInformation.ProtectionSettingInfo
Value = (new Random().Next(0, 10)).ToString() // 随机值 Value = (new Random().Next(0, 10)).ToString() // 随机值
}).ToList(); }).ToList();
} }
/// <summary>
/// 获取定值枚举数组
/// </summary>
/// <returns></returns>
[ShowApi]
[AbpAllowAnonymous]
[HttpGet]
public async Task<RequestResult< List<ImDeviceDzenumPu>>> GetDeviceSettingEnumPu()
{
RequestResult<List<ImDeviceDzenumPu>> rst = new();
try
{
var repo =await _imDeviceDzenumPuitory.GetAllAsync();
rst.ResultData = repo.ToList();
rst.Flag = true;
}
catch (Exception ex)
{
rst.Message = ex.Message;
}
return rst;
}
/// <summary>
/// 获取定值类型
/// </summary>
/// <returns></returns>
[ShowApi]
[AbpAllowAnonymous]
[HttpGet]
public async Task<RequestResult<List<ImDztype>>> GetDeviceSettingType()
{
RequestResult<List<ImDztype>> rst = new();
try
{
var repo = await _imDztypeRepository.GetAllAsync();
rst.ResultData = repo.ToList();
rst.Flag = true;
}
catch (Exception ex)
{
rst.Message = ex.Message;
}
return rst;
}
} }
} }

View File

@ -3785,6 +3785,18 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionSettingInfo.ProtectionSettingAppService.GetDeviceSettingEnumPu">
<summary>
获取定值枚举数组
</summary>
<returns></returns>
</member>
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionSettingInfo.ProtectionSettingAppService.GetDeviceSettingType">
<summary>
获取定值类型
</summary>
<returns></returns>
</member>
<member name="M:YunDa.ISAS.Application.GeneralInformation.ITransformerSubstationAppService.GetTransformerSubstationTreeNode(YunDa.ISAS.DataTransferObject.GeneralInformation.TransformerSubstationDto.TransformerSubstationSearchConditionInput)"> <member name="M:YunDa.ISAS.Application.GeneralInformation.ITransformerSubstationAppService.GetTransformerSubstationTreeNode(YunDa.ISAS.DataTransferObject.GeneralInformation.TransformerSubstationDto.TransformerSubstationSearchConditionInput)">
<summary> <summary>
获取变电所结构树 获取变电所结构树

View File

@ -45,5 +45,10 @@ namespace YunDa.SOMS.Entities.GeneralInformation
/// 更换后数据 /// 更换后数据
/// </summary> /// </summary>
public virtual string ContentNewJson { get; set; } public virtual string ContentNewJson { get; set; }
/// <summary>
/// 是否已经发送给主站
/// </summary>
public virtual bool IsSend { get; set; }
} }
} }