refactor:删除了DeviceDto,VariableDto,VariableTableDto,改为使用DMS.Core中的实体

This commit is contained in:
2025-10-07 17:51:24 +08:00
parent 94ad940e03
commit b753e5ea73
52 changed files with 291 additions and 463 deletions

View File

@@ -1,3 +1,5 @@
using DMS.Core.Models;
namespace DMS.Application.DTOs;
/// <summary>
@@ -5,8 +7,7 @@ namespace DMS.Application.DTOs;
/// </summary>
public class CreateDeviceWithDetailsDto
{
public DeviceDto Device { get; set; }
public VariableTableDto VariableTable { get; set; }
public Device Device { get; set; } public VariableTable VariableTable { get; set; }
public MenuBeanDto DeviceMenu { get; set; } // 如果需要包含菜单信息
public MenuBeanDto VariableTableMenu { get; set; } // 如果需要包含菜单信息

View File

@@ -5,7 +5,7 @@ namespace DMS.Application.DTOs
{
public class CreateVariableTableWithMenuDto
{
public VariableTableDto VariableTable { get; set; }
public VariableTable VariableTable { get; set; }
public int DeviceId { get; set; }
public MenuBeanDto Menu { get; set; }
}

View File

@@ -1,84 +0,0 @@
using DMS.Core.Enums;
namespace DMS.Application.DTOs;
/// <summary>
/// 用于在UI上显示设备基本信息的DTO。
/// </summary>
public class DeviceDto
{
/// <summary>
/// 设备唯一标识符
/// </summary>
public int Id { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 设备描述信息
/// </summary>
public string Description { get; set; }
/// <summary>
/// 通信协议类型
/// </summary>
public ProtocolType Protocol { get; set; }
/// <summary>
/// 设备IP地址
/// </summary>
public string IpAddress { get; set; }
/// <summary>
/// 设备端口号
/// </summary>
public int Port { get; set; }
/// <summary>
/// PLC机架号用于PLC连接
/// </summary>
public int Rack { get; set; }
/// <summary>
/// PLC插槽号用于PLC连接
/// </summary>
public int Slot { get; set; }
/// <summary>
/// CPU类型
/// </summary>
public CpuType CpuType { get; set; }
/// <summary>
/// 设备类型
/// </summary>
public DeviceType DeviceType { get; set; }
/// <summary>
/// OPC UA服务器URL
/// </summary>
public string OpcUaServerUrl { get; set; }
/// <summary>
/// 设备是否处于激活状态
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// 设备是否正在运行
/// </summary>
public bool IsRunning { get; set; }
/// <summary>
/// 设备当前状态("在线", "离线", "连接中..."
/// </summary>
public string Status { get; set; } // "在线", "离线", "连接中..."
/// <summary>
/// 设备关联的变量表集合
/// </summary>
public List<VariableTableDto> VariableTables { get; set; }=new List<VariableTableDto>();
}

View File

@@ -1,41 +0,0 @@
using DMS.Core.Enums;
using DMS.Core.Models;
using System;
using System.Collections.Generic;
namespace DMS.Application.DTOs;
/// <summary>
/// 用于在UI上显示变量基本信息的DTO。
/// </summary>
public class VariableDto
{
public int Id { get; set; }
public string Name { get; set; }
public string S7Address { get; set; }
public string DataValue { get; set; }
public double NumericValue { get; set; }
public string DisplayValue { get; set; }
public VariableTableDto? VariableTable { get; set; }
public List<MqttAlias>? MqttAliases { get; set; } = new List<MqttAlias>();
public SignalType SignalType { get; set; }
public int PollingInterval { get; set; }
public bool IsActive { get; set; }
public int VariableTableId { get; set; }
public string OpcUaNodeId { get; set; }
public bool IsHistoryEnabled { get; set; }
public double HistoryDeadband { get; set; }
public bool IsAlarmEnabled { get; set; }
public double AlarmMinValue { get; set; }
public double AlarmMaxValue { get; set; }
public double AlarmDeadband { get; set; }
public ProtocolType Protocol { get; set; }
public DataType DataType { get; set; }
public string ConversionFormula { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
public string UpdatedBy { get; set; }
public bool IsModified { get; set; }
public string Description { get; set; }
public OpcUaUpdateType OpcUaUpdateType { get; set; }
}

View File

@@ -1,18 +0,0 @@
using DMS.Core.Enums;
namespace DMS.Application.DTOs;
/// <summary>
/// 用于在UI上显示变量表基本信息的DTO。
/// </summary>
public class VariableTableDto
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public int DeviceId { get; set; }
public DeviceDto Device { get; set; }
public ProtocolType Protocol { get; set; }
public List<VariableDto> Variables { get; set; } = new();
}