2024-08-21 16:50:14 +08:00
|
|
|
|
using Abp.Application.Services;
|
|
|
|
|
using Abp.Authorization;
|
|
|
|
|
using Abp.Domain.Repositories;
|
|
|
|
|
using Abp.Domain.Uow;
|
2024-11-26 13:45:28 +08:00
|
|
|
|
using Abp.EntityFrameworkCore.Repositories;
|
2024-08-21 16:50:14 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text.RegularExpressions;
|
2024-11-26 13:45:28 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2024-08-21 16:50:14 +08:00
|
|
|
|
using YunDa.ISAS.Application.Core.SwaggerHelper;
|
|
|
|
|
using YunDa.ISAS.DataTransferObject;
|
|
|
|
|
using YunDa.ISAS.DataTransferObject.SecondaryElectricalEquipmentInfoDto.ProtectDeviceDto;
|
|
|
|
|
using YunDa.ISAS.Entities.DataMonitoring;
|
|
|
|
|
using YunDa.ISAS.Entities.GeneralInformation;
|
|
|
|
|
using YunDa.ISAS.Entities.MySQL.DataMonitoring;
|
|
|
|
|
using YunDa.ISMS.BASE.Entities.Models;
|
|
|
|
|
|
2024-11-26 13:45:28 +08:00
|
|
|
|
|
|
|
|
|
|
2024-08-21 16:50:14 +08:00
|
|
|
|
namespace YunDa.ISAS.Application.GeneralInformation
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 二次设备信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Description("二次设备信息")]
|
|
|
|
|
public class SecondaryElectricalEquipmentInfoAppService : ApplicationService
|
|
|
|
|
{
|
|
|
|
|
private readonly IRepository<ImDeviceDatum, string> _imDeviceDatumRepository;
|
|
|
|
|
private readonly IRepository<ImProtectDevice, string> _imProtectDeviceRepository;
|
|
|
|
|
private readonly IRepository<ImDeviceYc, string> _imDeviceYcRepository;
|
|
|
|
|
private readonly IRepository<ImDeviceYx, string> _imDeviceYxRepository;
|
|
|
|
|
|
|
|
|
|
private readonly IRepository<DMAlarmCategory, Guid> _dmalarmCategoryRepository;
|
|
|
|
|
|
|
|
|
|
private readonly IRepository<EquipmentInfo, Guid> _equipmentInfoRepository;
|
|
|
|
|
private readonly IRepository<TelemeteringConfiguration, Guid> _telemeteringConfigurationRepository;
|
|
|
|
|
private readonly IRepository<TelesignalisationConfiguration, Guid> _telesignalisationConfigurationRepository;
|
|
|
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
|
|
|
|
|
|
|
|
|
public SecondaryElectricalEquipmentInfoAppService(
|
|
|
|
|
IRepository<ImDeviceDatum, string> imDeviceDatumRepository,
|
|
|
|
|
IRepository<ImProtectDevice, string> imProtectDeviceRepository,
|
|
|
|
|
IRepository<EquipmentInfo, Guid> equipmentInfoRepository,
|
|
|
|
|
IRepository<TelemeteringConfiguration, Guid> telemeteringConfigurationRepository,
|
|
|
|
|
IRepository<TelesignalisationConfiguration, Guid> telesignalisationConfigurationRepository,
|
|
|
|
|
IRepository<DMAlarmCategory, Guid> dmalarmCategoryRepository,
|
|
|
|
|
IRepository<ImDeviceYc, string> imDeviceYcRepository,
|
|
|
|
|
IRepository<ImDeviceYx, string> imDeviceYxRepository,
|
|
|
|
|
IUnitOfWorkManager unitOfWorkManager
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
_imDeviceDatumRepository = imDeviceDatumRepository;
|
|
|
|
|
_imProtectDeviceRepository = imProtectDeviceRepository;
|
|
|
|
|
_equipmentInfoRepository = equipmentInfoRepository;
|
|
|
|
|
_telemeteringConfigurationRepository = telemeteringConfigurationRepository;
|
|
|
|
|
_telesignalisationConfigurationRepository = telesignalisationConfigurationRepository;
|
|
|
|
|
_unitOfWorkManager = unitOfWorkManager;
|
|
|
|
|
_imDeviceYcRepository = imDeviceYcRepository;
|
|
|
|
|
_imDeviceYxRepository = imDeviceYxRepository;
|
|
|
|
|
_dmalarmCategoryRepository = dmalarmCategoryRepository;
|
|
|
|
|
}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[AbpAllowAnonymous]
|
|
|
|
|
[ShowApi]
|
|
|
|
|
public RequestEasyResult Test()
|
|
|
|
|
{
|
|
|
|
|
RequestEasyResult rst = new RequestEasyResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var repo = _imProtectDeviceRepository.GetAllIncluding(t=>t.StatCodeNavigation);
|
|
|
|
|
foreach (var item in repo)
|
|
|
|
|
{
|
|
|
|
|
Debug.WriteLine(item.DeviceName+" " + item.Id);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
rst.Flag = true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
rst.Message = ex.Message;
|
|
|
|
|
}
|
|
|
|
|
return rst;
|
|
|
|
|
}
|
2024-11-26 13:45:28 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 迁移综自的数据到运维系统中 三遥信息
|
|
|
|
|
/// </summary>
|
2024-09-20 09:59:25 +08:00
|
|
|
|
static int index = 0;
|
2024-08-21 16:50:14 +08:00
|
|
|
|
[HttpGet]
|
|
|
|
|
[AbpAllowAnonymous]
|
|
|
|
|
[ShowApi]
|
|
|
|
|
[UnitOfWork(isTransactional: false)]
|
2024-11-26 13:45:28 +08:00
|
|
|
|
public async Task<RequestEasyResult> MergerDeviceData()
|
2024-08-21 16:50:14 +08:00
|
|
|
|
{
|
|
|
|
|
RequestEasyResult rst = new RequestEasyResult();
|
|
|
|
|
try
|
|
|
|
|
{
|
2024-11-26 13:45:28 +08:00
|
|
|
|
// 初始化数据
|
|
|
|
|
List<ImDeviceDatum> deviceDatas;
|
|
|
|
|
List<ImDeviceYc> ImDeviceYcs;
|
|
|
|
|
List<ImDeviceYx> ImDeviceYxs;
|
|
|
|
|
List<DMAlarmCategory> dmalarmCategories;
|
|
|
|
|
List<EquipmentInfo> equipments;
|
|
|
|
|
|
2024-08-21 16:50:14 +08:00
|
|
|
|
using (var unitOfWork = _unitOfWorkManager.Begin())
|
|
|
|
|
{
|
|
|
|
|
deviceDatas = _imDeviceDatumRepository.GetAllIncluding(t => t.Device).ToList();
|
|
|
|
|
ImDeviceYcs = _imDeviceYcRepository.GetAll().ToList();
|
|
|
|
|
ImDeviceYxs = _imDeviceYxRepository.GetAll().ToList();
|
|
|
|
|
unitOfWork.Complete();
|
|
|
|
|
}
|
|
|
|
|
using (var unitOfWork = _unitOfWorkManager.Begin())
|
|
|
|
|
{
|
|
|
|
|
equipments = _equipmentInfoRepository.GetAll().ToList();
|
|
|
|
|
dmalarmCategories = _dmalarmCategoryRepository.GetAll().ToList();
|
|
|
|
|
unitOfWork.Complete();
|
|
|
|
|
}
|
2024-12-12 17:18:46 +08:00
|
|
|
|
|
2024-11-26 13:45:28 +08:00
|
|
|
|
// 将设备数据和设备映射到字典中
|
|
|
|
|
var equipmentDict = equipments.ToDictionary(e => e.Name);
|
|
|
|
|
var telemeteringConfigIds = new HashSet<string>(_telemeteringConfigurationRepository.GetAll().Select(t => t.ismsbaseYCId));
|
|
|
|
|
var telesignalisationConfigIds = new HashSet<string>(_telesignalisationConfigurationRepository.GetAll().Select(t => t.ismsbaseYXId));
|
|
|
|
|
|
|
|
|
|
List<TelemeteringConfiguration> telemeteringConfigurations = new List<TelemeteringConfiguration>();
|
|
|
|
|
List<TelesignalisationConfiguration> telesignalisationConfigurations = new List<TelesignalisationConfiguration>();
|
|
|
|
|
|
|
|
|
|
foreach (var deviceData in deviceDatas)
|
2024-08-21 16:50:14 +08:00
|
|
|
|
{
|
2024-11-26 13:45:28 +08:00
|
|
|
|
if (!equipmentDict.TryGetValue(deviceData.Device.DeviceName, out var equipment))
|
|
|
|
|
{
|
|
|
|
|
continue; // 未匹配到设备,跳过
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-12 17:18:46 +08:00
|
|
|
|
if (deviceData.DataType == "YC")
|
2024-11-26 13:45:28 +08:00
|
|
|
|
{
|
|
|
|
|
var yc = ImDeviceYcs.FirstOrDefault(t => t.Id == deviceData.Id);
|
2024-12-12 17:18:46 +08:00
|
|
|
|
if (telemeteringConfigIds.Contains(deviceData.Id))
|
2024-11-26 13:45:28 +08:00
|
|
|
|
{
|
2024-12-12 17:18:46 +08:00
|
|
|
|
// 更新已有的 Telemetering 配置
|
|
|
|
|
var existingTelemeteringConfig = _telemeteringConfigurationRepository
|
|
|
|
|
.FirstOrDefault(t => t.ismsbaseYCId == deviceData.Id);
|
|
|
|
|
if (existingTelemeteringConfig != null)
|
2024-11-26 13:45:28 +08:00
|
|
|
|
{
|
2024-12-12 17:18:46 +08:00
|
|
|
|
existingTelemeteringConfig.Coefficient = (float)yc.Cof;
|
|
|
|
|
existingTelemeteringConfig.DecimalDigits = (int)yc.Precise;
|
|
|
|
|
existingTelemeteringConfig.Name = deviceData.DataName;
|
|
|
|
|
existingTelemeteringConfig.Unit = yc.Unit;
|
|
|
|
|
existingTelemeteringConfig.IsSelfCheckingValue = false; // 假设这是需要更新的字段
|
|
|
|
|
existingTelemeteringConfig.EquipmentInfoId = equipment.Id; // 更新设备信息ID
|
|
|
|
|
existingTelemeteringConfig.EquipmentTypeId = equipment.EquipmentTypeId; // 更新设备类型ID
|
|
|
|
|
existingTelemeteringConfig.TransformerSubstationId = equipment.TransformerSubstationId; // 更新变电站ID
|
|
|
|
|
existingTelemeteringConfig.IsVirtualDevice = false; // 假设这是需要更新的字段
|
|
|
|
|
existingTelemeteringConfig.IsEnvironmentTemp = false; // 假设这是需要更新的字段
|
|
|
|
|
existingTelemeteringConfig.InfoAddress = deviceData.InfoAddr; // 更新信息地址
|
|
|
|
|
existingTelemeteringConfig.DispatcherAddress = deviceData.InfoAddr; // 更新调度器地址
|
|
|
|
|
existingTelemeteringConfig.IsActive = true; // 更新是否激活
|
|
|
|
|
existingTelemeteringConfig.IsSave = true; // 更新是否保存
|
|
|
|
|
existingTelemeteringConfig.IsVisible = true; // 更新是否可见
|
|
|
|
|
existingTelemeteringConfig.SeqNo = 0; // 假设这是需要更新的字段
|
|
|
|
|
existingTelemeteringConfig.CPUSector = 0; ; // 更新CPU扇区
|
|
|
|
|
existingTelemeteringConfig.InfoCPUSector = deviceData.CpuIndex; ; // 更新信息CPU扇区
|
|
|
|
|
existingTelemeteringConfig.CreatorUserId = default; // 更新创建用户ID(如果需要)
|
|
|
|
|
existingTelemeteringConfig.LastModificationTime = DateTime.Now; // 更新创建时间
|
|
|
|
|
// 这里可以添加更多的更新字段
|
|
|
|
|
// 保存到数据库
|
|
|
|
|
_telemeteringConfigurationRepository.Update(existingTelemeteringConfig);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (yc != null)
|
|
|
|
|
{
|
|
|
|
|
telemeteringConfigurations.Add(new TelemeteringConfiguration
|
|
|
|
|
{
|
|
|
|
|
DataSourceCategory = DataSourceCategoryEnum.Zongzi,
|
|
|
|
|
Coefficient = (float)yc.Cof,
|
|
|
|
|
CPUSector = 0,
|
|
|
|
|
CreationTime = DateTime.Now,
|
|
|
|
|
CreatorUserId = default,
|
|
|
|
|
DeviceAddress = 1,
|
|
|
|
|
DecimalDigits = (int)yc.Precise,
|
|
|
|
|
DispatcherAddress = deviceData.InfoAddr,
|
|
|
|
|
InfoAddress = deviceData.InfoAddr,
|
|
|
|
|
InfoCPUSector = 0,
|
|
|
|
|
IsSelfCheckingValue = false,
|
|
|
|
|
EquipmentInfoId = equipment.Id,
|
|
|
|
|
EquipmentTypeId = equipment.EquipmentTypeId,
|
|
|
|
|
IsActive = true,
|
|
|
|
|
IsSave = true,
|
|
|
|
|
Name = deviceData.DataName,
|
|
|
|
|
IsVisible = true,
|
|
|
|
|
SeqNo = 0,
|
|
|
|
|
TransformerSubstationId = equipment.TransformerSubstationId,
|
|
|
|
|
Unit = yc.Unit,
|
|
|
|
|
IsVirtualDevice = false,
|
|
|
|
|
IsEnvironmentTemp = false,
|
|
|
|
|
ismsbaseYCId = deviceData.Id
|
|
|
|
|
});
|
|
|
|
|
telemeteringConfigIds.Add(deviceData.Id); // 添加到已存在集合中
|
|
|
|
|
}
|
2024-11-26 13:45:28 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-12 17:18:46 +08:00
|
|
|
|
else if (deviceData.DataType == "YX")
|
2024-08-21 16:50:14 +08:00
|
|
|
|
{
|
2024-11-26 13:45:28 +08:00
|
|
|
|
var yx = ImDeviceYxs.FirstOrDefault(t => t.Id == deviceData.Id);
|
2024-12-12 17:18:46 +08:00
|
|
|
|
if (telesignalisationConfigIds.Contains(deviceData.Id))
|
2024-08-21 16:50:14 +08:00
|
|
|
|
{
|
2024-12-12 17:18:46 +08:00
|
|
|
|
// 更新已有的 Telesignalisation 配置
|
|
|
|
|
var existingTelesignalisationConfig = _telesignalisationConfigurationRepository
|
|
|
|
|
.FirstOrDefault(t => t.ismsbaseYXId == deviceData.Id);
|
|
|
|
|
if (existingTelesignalisationConfig != null)
|
2024-08-21 16:50:14 +08:00
|
|
|
|
{
|
2024-12-12 17:18:46 +08:00
|
|
|
|
// 处理 AlertLevel 字段
|
|
|
|
|
string levelStr = Regex.Match(yx.AlertLevel, @"\d+")?.Value;
|
|
|
|
|
if (string.IsNullOrWhiteSpace(levelStr))
|
|
|
|
|
{
|
|
|
|
|
levelStr = "4"; // 默认值
|
|
|
|
|
}
|
|
|
|
|
var defaultDma = dmalarmCategories.FirstOrDefault(t => t.Level == int.Parse(levelStr));
|
|
|
|
|
|
|
|
|
|
// 更新 Telesignalisation 配置的各个字段
|
|
|
|
|
existingTelesignalisationConfig.YesContent = yx.SwOnStr ?? ""; // 如果为空,设置为默认值
|
|
|
|
|
existingTelesignalisationConfig.NoContent = yx.SwOffStr ?? ""; // 如果为空,设置为默认值
|
|
|
|
|
existingTelesignalisationConfig.UnsurenessContent = yx.SwUncertStr ?? "不定"; // 如果为空,设置为默认值
|
|
|
|
|
existingTelesignalisationConfig.DMAlarmCategoryId = defaultDma?.Id; // 更新报警分类ID
|
|
|
|
|
existingTelesignalisationConfig.Name = deviceData.DataName; // 更新名称
|
|
|
|
|
existingTelesignalisationConfig.InfoAddress = deviceData.InfoAddr; // 更新信息地址
|
|
|
|
|
existingTelesignalisationConfig.DispatcherAddress = deviceData.InfoAddr; // 更新调度器地址
|
|
|
|
|
existingTelesignalisationConfig.EquipmentInfoId = equipment.Id; // 更新设备信息ID
|
|
|
|
|
existingTelesignalisationConfig.EquipmentTypeId = equipment.EquipmentTypeId; // 更新设备类型ID
|
|
|
|
|
existingTelesignalisationConfig.TransformerSubstationId = equipment.TransformerSubstationId; // 更新变电站ID
|
|
|
|
|
existingTelesignalisationConfig.IsActive = true; // 更新是否激活
|
|
|
|
|
existingTelesignalisationConfig.IsSave = true; // 更新是否保存
|
|
|
|
|
existingTelesignalisationConfig.IsVisible = true; // 更新是否可见
|
|
|
|
|
existingTelesignalisationConfig.SeqNo = 0; // 假设需要设置序号
|
|
|
|
|
existingTelesignalisationConfig.CPUSector = 0; // 更新CPU扇区
|
|
|
|
|
existingTelesignalisationConfig.InfoCPUSector = deviceData.CpuIndex; // 更新信息CPU扇区
|
|
|
|
|
existingTelesignalisationConfig.IsVirtualDevice = false; // 更新虚拟设备标志
|
|
|
|
|
existingTelesignalisationConfig.CreatorUserId = default; // 更新创建用户ID
|
|
|
|
|
existingTelesignalisationConfig.LastModificationTime = DateTime.Now; // 更新创建时间
|
|
|
|
|
|
|
|
|
|
// 这里可以继续添加其他字段更新的代码
|
2024-11-26 13:45:28 +08:00
|
|
|
|
|
2024-12-12 17:18:46 +08:00
|
|
|
|
// 保存到数据库
|
|
|
|
|
_telesignalisationConfigurationRepository.Update(existingTelesignalisationConfig);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (yx != null)
|
2024-11-26 13:45:28 +08:00
|
|
|
|
{
|
2024-12-12 17:18:46 +08:00
|
|
|
|
string levelStr = Regex.Match(yx.AlertLevel, @"\d+")?.Value;
|
|
|
|
|
if (string.IsNullOrWhiteSpace(levelStr))
|
|
|
|
|
{
|
|
|
|
|
levelStr = "4";
|
|
|
|
|
}
|
|
|
|
|
var defaultDma = dmalarmCategories.FirstOrDefault(t => t.Level == int.Parse(levelStr));
|
|
|
|
|
|
|
|
|
|
telesignalisationConfigurations.Add(new TelesignalisationConfiguration
|
|
|
|
|
{
|
|
|
|
|
DataSourceCategory = DataSourceCategoryEnum.Zongzi,
|
|
|
|
|
CPUSector = 0,
|
|
|
|
|
CreationTime = DateTime.Now,
|
|
|
|
|
CreatorUserId = default,
|
|
|
|
|
DispatcherAddress = deviceData.InfoAddr,
|
|
|
|
|
InfoAddress = deviceData.InfoAddr,
|
|
|
|
|
DeviceAddress = 1,
|
|
|
|
|
InfoCPUSector = 0,
|
|
|
|
|
IsSelfCheckingValue = false,
|
|
|
|
|
EquipmentInfoId = equipment.Id,
|
|
|
|
|
EquipmentTypeId = equipment.EquipmentTypeId,
|
|
|
|
|
YesContent = yx.SwOnStr ?? "",
|
|
|
|
|
NoContent = yx.SwOffStr ?? "",
|
|
|
|
|
UnsurenessContent = yx.SwUncertStr ?? "",
|
|
|
|
|
DMAlarmCategoryId = defaultDma?.Id,
|
|
|
|
|
IsActive = true,
|
|
|
|
|
IsSave = true,
|
|
|
|
|
Name = deviceData.DataName,
|
|
|
|
|
IsVisible = true,
|
|
|
|
|
SeqNo = 0,
|
|
|
|
|
TransformerSubstationId = equipment.TransformerSubstationId,
|
|
|
|
|
IsVirtualDevice = false,
|
|
|
|
|
ismsbaseYXId = deviceData.Id
|
|
|
|
|
});
|
|
|
|
|
telesignalisationConfigIds.Add(deviceData.Id); // 添加到已存在集合中
|
|
|
|
|
}
|
2024-08-21 16:50:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-26 13:45:28 +08:00
|
|
|
|
}
|
2024-08-21 16:50:14 +08:00
|
|
|
|
|
2024-12-12 17:18:46 +08:00
|
|
|
|
// 批量插入或更新数据库
|
2024-11-26 13:45:28 +08:00
|
|
|
|
using (var unitOfWork = _unitOfWorkManager.Begin())
|
|
|
|
|
{
|
|
|
|
|
if (telemeteringConfigurations.Any())
|
2024-12-12 17:18:46 +08:00
|
|
|
|
await _telemeteringConfigurationRepository.InsertRangeAsync(telemeteringConfigurations);
|
2024-11-26 13:45:28 +08:00
|
|
|
|
if (telesignalisationConfigurations.Any())
|
|
|
|
|
await _telesignalisationConfigurationRepository.InsertRangeAsync(telesignalisationConfigurations);
|
2024-08-21 16:50:14 +08:00
|
|
|
|
|
2024-12-12 17:18:46 +08:00
|
|
|
|
// 完成数据库操作
|
|
|
|
|
await unitOfWork.CompleteAsync();
|
2024-08-21 16:50:14 +08:00
|
|
|
|
}
|
2024-11-26 13:45:28 +08:00
|
|
|
|
|
2024-08-21 16:50:14 +08:00
|
|
|
|
rst.Flag = true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
2024-11-26 13:45:28 +08:00
|
|
|
|
rst.Flag = false;
|
|
|
|
|
rst.Message = ex.Message;
|
2024-08-21 16:50:14 +08:00
|
|
|
|
}
|
2024-11-26 13:45:28 +08:00
|
|
|
|
|
2024-08-21 16:50:14 +08:00
|
|
|
|
return rst;
|
|
|
|
|
}
|
2024-09-20 09:59:25 +08:00
|
|
|
|
|
2024-11-26 13:45:28 +08:00
|
|
|
|
|
2024-12-12 17:18:46 +08:00
|
|
|
|
|
2024-08-21 16:50:14 +08:00
|
|
|
|
//[HttpGet]
|
|
|
|
|
//[AbpAllowAnonymous]
|
|
|
|
|
//[ShowApi]
|
|
|
|
|
//public RequestResult<List<ProtectDeviceOutput>> FindProtectDevicesData(string stationName)
|
|
|
|
|
//{
|
|
|
|
|
// RequestResult<List<ProtectDeviceOutput>> rst = new();
|
|
|
|
|
|
|
|
|
|
// try
|
|
|
|
|
// {
|
|
|
|
|
// var repo = _imProtectDeviceRepository.GetAllIncluding();
|
|
|
|
|
// rst.ResultData =ObjectMapper.Map<List<ProtectDeviceOutput>>(repo);
|
|
|
|
|
// rst.Flag = true;
|
|
|
|
|
// }
|
|
|
|
|
// catch (Exception ex)
|
|
|
|
|
// {
|
|
|
|
|
// rst.Flag = false;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// return rst;
|
|
|
|
|
//}
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[AbpAllowAnonymous]
|
|
|
|
|
[ShowApi]
|
|
|
|
|
public RequestResult<List<ProtectDeviceOutput>> FindDevicesData(string devName)
|
|
|
|
|
{
|
|
|
|
|
RequestResult<List<ProtectDeviceOutput>> rst = new();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//var repo = _imDeviceDatumRepository.GetAllIncluding(t=>t.Device).Where(t=>t.Device.DeviceName == protectDevName);
|
|
|
|
|
rst.Flag = true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
rst.Flag = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return rst;
|
|
|
|
|
}
|
2024-08-22 14:18:13 +08:00
|
|
|
|
|
|
|
|
|
|
2024-08-21 16:50:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|