|
|
|
@ -126,12 +126,12 @@ namespace PVDEMCS.Services.Repositories.Impl
|
|
|
|
|
var query = context.DeviceInfos.Where(f => !f.IsDelete);
|
|
|
|
|
if (query.Where(f => f.DeviceName == entity.DeviceName).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.DeviceName}】的数据";
|
|
|
|
|
result.Message = $"已存在DeviceName:【{entity.DeviceName}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
if (query.Where(f => f.DeviceCode == entity.DeviceCode).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.DeviceCode}】的数据";
|
|
|
|
|
result.Message = $"已存在DeviceCode:【{entity.DeviceCode}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -163,12 +163,12 @@ namespace PVDEMCS.Services.Repositories.Impl
|
|
|
|
|
}
|
|
|
|
|
if (query.Where(f => f.DeviceName == entity.DeviceName && f.Id != entity.Id).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.DeviceName}】的数据";
|
|
|
|
|
result.Message = $"已存在DeviceName:【{entity.DeviceName}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
if (query.Where(f => f.DeviceCode == entity.DeviceCode && f.Id != entity.Id).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.DeviceCode}】的数据";
|
|
|
|
|
result.Message = $"已存在DeviceCode:【{entity.DeviceCode}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -355,12 +355,12 @@ namespace PVDEMCS.Services.Repositories.Impl
|
|
|
|
|
var query = context.DevicePoints.Where(f => !f.IsDelete);
|
|
|
|
|
if (query.Where(f => f.PointName == entity.PointName).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.PointName}】的数据";
|
|
|
|
|
result.Message = $"已存在PointName:【{entity.PointName}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
if (query.Where(f => f.PointCode == entity.PointCode).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.PointCode}】的数据";
|
|
|
|
|
result.Message = $"已存在PointCode:【{entity.PointCode}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -393,12 +393,12 @@ namespace PVDEMCS.Services.Repositories.Impl
|
|
|
|
|
}
|
|
|
|
|
if (query.Where(f => f.PointName == entity.PointName && f.Id != entity.Id).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.PointName}】的数据";
|
|
|
|
|
result.Message = $"已存在PointName:【{entity.PointName}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
if (query.Where(f => f.PointCode == entity.PointCode && f.Id != entity.Id).FirstOrDefault() != null)
|
|
|
|
|
{
|
|
|
|
|
result.Message = $"没有找到Id:【{entity.PointCode}】的数据";
|
|
|
|
|
result.Message = $"已存在PointCode:【{entity.PointCode}】的数据";
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
update.DeviceId = entity.DeviceId;
|
|
|
|
|