按照软件设计文档开始重构代码01

This commit is contained in:
2025-07-21 14:35:17 +08:00
parent a7b0a5d108
commit 29a2d44319
127 changed files with 12265 additions and 1586 deletions

View File

@@ -44,11 +44,11 @@ namespace DMS.Infrastructure.Services
stopwatch.Start();
var dbList = await GetAllAsync();
//查询设备的名字是否存在
if (dbList.Any(d => d.Name == device.Name || (d.Ip == device.Ip && d.Prot == device.Prot) || d.OpcUaEndpointUrl == device.OpcUaEndpointUrl))
{
NlogHelper.Warn("设备的名称Ip:端口OpcUrl,不可以重复。");
return resDevice;
}
// if (dbList.Any(d => d.Name == device.Name || (d.Ip == device.Ip && d.Prot == device.Prot) || d.OpcUaEndpointUrl == device.OpcUaEndpointUrl))
// {
// NlogHelper.Warn("设备的名称Ip:端口OpcUrl,不可以重复。");
// return resDevice;
// }
// 2. 将设备添加到数据库
var addDevice = await _deviceRepository.AddAsync(_mapper.Map<DbDevice>(device));