This commit is contained in:
郭睿 2024-12-09 11:05:28 +08:00
commit 7b8a1a1ed2

View File

@ -66,8 +66,8 @@ namespace YunDa.ISAS.Application.GeneralInformation
private readonly IRepository<ImDeviceDz, string> _imDeviceDzRepository;
private readonly IRedisRepository<ImDeviceDzOutput, string> _imDeviceDzRedis;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public ProtectionDeviceAppService(
private readonly IRedisRepository<BCodeAndNTP, string> _bcodeAndNTP;
public ProtectionDeviceAppService(
IRepository<ProtectionDeviceInfo, Guid> protectionDeviceInfoRepository,
IUnitOfWorkManager unitOfWorkManager,
IRepository<ImProtectDevice, string> imProtectDeviceRepository,
@ -88,6 +88,7 @@ namespace YunDa.ISAS.Application.GeneralInformation
IRepository<TransformerSubstation, Guid> transformerSubstationRepository,
IRepository<ImDeviceDz, string> imDeviceDzRepository,
IRepository<ImEventType, int> imEventTypeRepository,
IRedisRepository<BCodeAndNTP, string> bcodeAndNTP,
ISessionAppService sessionAppService
) :
base(sessionAppService)
@ -111,6 +112,7 @@ namespace YunDa.ISAS.Application.GeneralInformation
_imEventTypeRepository = imEventTypeRepository;
_telemeteringConfigurationRepository = telemeteringConfigurationRepository;
_telesignalisationConfigurationRepository = telesignalisationConfigurationRepository;
_bcodeAndNTP = bcodeAndNTP;
}
public async Task<RequestResult<ProtectionDeviceInfoViewOutput>> CreateOrUpdateAsync(EditProtectionDeviceInfoInput input)
{
@ -1070,6 +1072,30 @@ namespace YunDa.ISAS.Application.GeneralInformation
}
return rst;
}
[AbpAllowAnonymous]
[HttpGet]
[DisableAuditing]
public async Task<RequestResult<BCodeAndNTP>> GetDeviceBCondeAndNTP(Guid equipmentInfoId)
{
RequestResult<BCodeAndNTP> rst = new();
try
{
var device = _protectionDeviceInfoRepository.GetAll().FirstOrDefault(t => t.EquipmentInfoId == equipmentInfoId);
if (device!=null)
{
var entity =await _bcodeAndNTP.HashSetGetOneAsync(nameof(BCodeAndNTP), device.DeviceAddress.ToString());
rst.ResultData = entity;
rst.Flag = true;
}
}
catch (Exception ex)
{
rst.Message = ex.Message;
Log4Helper.Error(this.GetType(), "线路管理服务", ex);
}
return rst;
}
#if DEBUG
/// <summary>
/// 填充出厂编号