This commit is contained in:
郭睿 2024-12-02 16:30:01 +08:00
commit 35a4749766
3 changed files with 88 additions and 5 deletions

View File

@ -102,6 +102,7 @@ namespace YunDa.ISAS.Application.GeneralInformation
_manufacturerInfoRepository = manufacturerInfoRepository;
_transformerSubstationRepository = transformerSubstationRepository;
_imDeviceDzRepository = imDeviceDzRepository;
_imEventTypeRepository = imEventTypeRepository;
}
public async Task<RequestResult<ProtectionDeviceInfoViewOutput>> CreateOrUpdateAsync(EditProtectionDeviceInfoInput input)
{
@ -920,8 +921,76 @@ namespace YunDa.ISAS.Application.GeneralInformation
}
return rst;
}
/// <summary>
/// 获取装置状态
/// </summary>
/// <param name="equipmentInfoId"></param>
/// <returns></returns>
[ShowApi]
[AbpAllowAnonymous]
[HttpGet]
[DisableAuditing]
[UnitOfWork(isTransactional: false)]
public async Task<RequestResult<DeviceStatus>> GetDeviceStatusAsync(Guid equipmentInfoId)
{
RequestResult<DeviceStatus> rst = new RequestResult<DeviceStatus>();
try
{
ProtectionDeviceInfo protectionDeviceInfo = default;
using (var unitOfWork = _unitOfWorkManager.Begin())
{
protectionDeviceInfo = _protectionDeviceInfoRepository.GetAllIncluding(t=>t.EquipmentInfo).FirstOrDefault(t=>t.EquipmentInfoId == equipmentInfoId);
await unitOfWork.CompleteAsync();
}
if (protectionDeviceInfo != null)
{
using (var unitOfWork = _unitOfWorkManager.Begin())
{
var device = _imProtectDeviceRepository.GetAllIncluding(t=>t.GateWay).FirstOrDefault(t => t.Id == protectionDeviceInfo.ISMS_DeviceId);
if (device != null)
{
DeviceStatus deviceStatus = new DeviceStatus()
{
ConnectionStatus104=0,
EquipmentInfoId = equipmentInfoId,
EquipmentInfoName = protectionDeviceInfo.EquipmentInfo.Name,
FreeMemory = "0KB",
UsedMemory ="0KB",
LcdOperationPassword ="",
ProtectionDeviceId = protectionDeviceInfo.Id,
TotalDisk = "0MB",
UsedDisk ="0MB",
NetworkInterfaces = new List<NetworkInterfaceStatus>
{
new NetworkInterfaceStatus
{
IpAddress =device.GateWay.GatewayIp1,
InterfaceName ="eth0",
},
new NetworkInterfaceStatus
{
IpAddress =device.GateWay.GatewayIp2,
InterfaceName ="eth1",
},
}
};
rst.ResultData = deviceStatus;
rst.Flag = true;
}
await unitOfWork.CompleteAsync();
}
}
}
catch (Exception ex)
{
rst.Message = ex.Message;
Log4Helper.Error(this.GetType(), "线路管理服务", ex);
}
return rst;
}
#if DEBUG
/// <summary>
/// 填充出厂编号
@ -960,7 +1029,6 @@ namespace YunDa.ISAS.Application.GeneralInformation
}
return rst;
}
/// <summary>
/// 填充出厂编号
/// </summary>

View File

@ -132,11 +132,11 @@ namespace YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo
entity.DeviceAddress = 1;
entity.InfoAddress = 0;
entity.InfoCPUSector = 0;
entity.InfoDeviceAddress = dispatchaddr;
entity.InfoDeviceAddress = 1;
entity.IsVirtualDevice = true;
entity.IsSelfCheckingValue = false;
entity.Name = $"{secondaryCircuitName}_判定遥测";
entity.SeqNo = 100000;
entity.SeqNo = dispatchaddr;
entity.IsActive = true;
entity.IsSave = false;
entity.IsSendDispatcher = false;
@ -168,7 +168,7 @@ namespace YunDa.ISAS.Application.GeneralInformation.SecondaryCircuitInfo
InfoDeviceAddress = 0,
IsVirtualDevice = true,
IsSelfCheckingValue = false,
SeqNo = 100000,
SeqNo = dispatchaddr,
IsActive = true,
IsSave = false,
IsSendDispatcher = true,

View File

@ -3570,6 +3570,21 @@
</summary>
<returns></returns>
</member>
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionDeviceAppService.GetDeviceEventType(System.Int32,System.Int32)">
<summary>
获取装置时间类型
</summary>
<param name="deviceAddr"></param>
<param name="eventCode"></param>
<returns></returns>
</member>
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionDeviceAppService.GetDeviceStatusAsync(System.Guid)">
<summary>
获取装置状态
</summary>
<param name="equipmentInfoId"></param>
<returns></returns>
</member>
<member name="M:YunDa.ISAS.Application.GeneralInformation.ProtectionDeviceAppService.UpdateProtetionInfoForTest">
<summary>
填充出厂编号