主站网关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

@ -576,6 +576,7 @@ namespace YunDa.ISAS.Application.GeneralInformation
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"
};
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.ResultData = deviceCommInfo;
}
rst.Flag = true;
}
catch (Exception ex)

View File

@ -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
/// <param name="cpuIndex"></param>
/// <returns></returns>
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");
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();
}
/// <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>
<returns></returns>
</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)">
<summary>
获取变电所结构树

View File

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