diff --git a/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs b/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs index e712445..e920474 100644 --- a/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs +++ b/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs @@ -8,6 +8,8 @@ using System.Collections.Generic; using SqlSugar; using static SKIT.FlurlHttpClient.Wechat.Api.Models.WxaBusinessGetLiveInfoResponse.Types; using System.Threading.Tasks; +using ZR.Repository; +using Aliyun.OSS; //创建时间:2025-08-05 namespace ZR.Admin.WebApi.Controllers.Business @@ -107,6 +109,28 @@ namespace ZR.Admin.WebApi.Controllers.Business return SUCCESS(info); } + + /// + /// 查询端口详情 + /// + /// + /// + [HttpGet("search")] + [ActionPermissionFilter(Permission = "odfports:query")] + public async Task GetOdfPortsInfo([FromQuery] OdfPortsSearchDto dto) + { + var key = dto.Key; + if (string.IsNullOrEmpty(key)) + { + return SUCCESS(new List()); + } + var predicate = Expressionable.Create(); + var list = _OdfPortsService.AsQueryable().Where(it => it.Name.Contains(key) || it.Remarks.Contains(key) || it.HistoryRemarks.Contains(key) || it.OpticalAttenuation.Contains(key)).ToPage(dto); + + return SUCCESS(list); + } + + /// /// 修改端口 /// diff --git a/ZR.Model/Business/Dto/OdfPortsDto.cs b/ZR.Model/Business/Dto/OdfPortsDto.cs index 0cb4fa1..b56132d 100644 --- a/ZR.Model/Business/Dto/OdfPortsDto.cs +++ b/ZR.Model/Business/Dto/OdfPortsDto.cs @@ -58,6 +58,11 @@ namespace ZR.Model.Business.Dto public string Name { get; set; } public List odfPortsList { get; set; } = new List(); } + + public class OdfPortsSearchDto : PagerInfo + { + public string Key { get; set; } + } public class OdfPortsMDto { @@ -164,6 +169,84 @@ namespace ZR.Model.Business.Dto public string DeptName { get; set; } } + + /// + /// 端口输入输出对象 + /// + public class OdfPortsQuDto + { + [Required(ErrorMessage = "Id不能为空")] + [ExcelColumn(Name = "Id")] + [ExcelColumnName("Id")] + public int Id { get; set; } + + [Required(ErrorMessage = "端口名称不能为空")] + [ExcelColumn(Name = "端口名称")] + [ExcelColumnName("端口名称")] + public string Name { get; set; } + + [Required(ErrorMessage = "机房ID不能为空")] + [ExcelColumn(Name = "机房ID")] + [ExcelColumnName("机房ID")] + public int RoomId { get; set; } + + [Required(ErrorMessage = "机房名称不能为空")] + [ExcelColumn(Name = "机房名称")] + [ExcelColumnName("机房名称")] + public string RoomName { get; set; } + + [Required(ErrorMessage = "机架ID不能为空")] + [ExcelColumn(Name = "机架ID")] + [ExcelColumnName("机架ID")] + public int RackId { get; set; } + + [Required(ErrorMessage = "机架名称不能为空")] + [ExcelColumn(Name = "机架名称")] + [ExcelColumnName("机架名称")] + public string RackName { get; set; } + + [Required(ErrorMessage = "框ID不能为空")] + [ExcelColumn(Name = "框ID")] + [ExcelColumnName("框ID")] + public int FrameId { get; set; } + + [Required(ErrorMessage = "框名称不能为空")] + [ExcelColumn(Name = "框名称")] + [ExcelColumnName("框名称")] + public string FrameName { get; set; } + + + + [Required(ErrorMessage = "行号(1-6)不能为空")] + [ExcelColumn(Name = "行号(1-6)")] + [ExcelColumnName("行号(1-6)")] + public int RowNumber { get; set; } + + [Required(ErrorMessage = "端口号(1-12)不能为空")] + [ExcelColumn(Name = "端口号(1-12)")] + [ExcelColumnName("端口号(1-12)")] + public int PortNumber { get; set; } + + [Required(ErrorMessage = "连接状态,0正常,1断开不能为空")] + [ExcelColumn(Name = "连接状态,0正常,1断开")] + [ExcelColumnName("连接状态,0正常,1断开")] + public int Status { get; set; } + + [ExcelColumn(Name = "备注")] + [ExcelColumnName("备注")] + public string Remarks { get; set; } + + [ExcelColumn(Name = "光衰值(dB)")] + [ExcelColumnName("光衰值(dB)")] + public string OpticalAttenuation { get; set; } + + [ExcelColumn(Name = "历史故障表")] + [ExcelColumnName("历史故障表")] + public string HistoryRemarks { get; set; } + + } + + /// /// 端口输入输出对象 ///