diff --git a/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs b/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs index 3ec5d24..2e9c2c7 100644 --- a/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs +++ b/ZR.Admin.WebApi/Controllers/Business/OdfPortsController.cs @@ -1,20 +1,27 @@ -using Microsoft.AspNetCore.Mvc; -using ZR.Model.Business.Dto; -using ZR.Model.Business; -using ZR.Service.Business.IBusinessService; -using MiniExcelLibs; -using ZR.Service.Business; -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; -using System.Linq; -using ZR.Model.System.Dto; + using Microsoft.AspNetCore.Connections.Features; -using System.Text.RegularExpressions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.IdentityModel.Tokens; + +using MiniExcelLibs; + +using SqlSugar; + +using System.Collections.Generic; +using System.Linq; using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +using ZR.Model.Business; +using ZR.Model.Business.Dto; +using ZR.Model.System.Dto; +using ZR.Repository; +using ZR.Service.Business; +using ZR.Service.Business.IBusinessService; + +using static SKIT.FlurlHttpClient.Wechat.Api.Models.WxaBusinessGetLiveInfoResponse.Types; //创建时间:2025-08-05 namespace ZR.Admin.WebApi.Controllers.Business @@ -380,11 +387,9 @@ namespace ZR.Admin.WebApi.Controllers.Business port.OpticalAttenuation = parm.OpticalAttenuation; port.UpdatedAt = DateTime.Now; port.OpticalCableOffRemarks = parm.OpticalCableOffRemarks; - if (port.Status == 0) { port.Remarks = ""; - port.OpticalCableOffRemarks = ""; } else { @@ -644,7 +649,28 @@ namespace ZR.Admin.WebApi.Controllers.Business } //添加端口 var port = _OdfPortsService.AsQueryable().Where(it => it.FrameId == frame.Id && it.RowNumber == excelItem.RowNumber && it.PortNumber == excelItem.PortNumber).First(); - string remarks = $"{excelItem.YeWuMingCheng.Trim()} {excelItem.EquipmentModel.Trim()} {excelItem.BusinessType.Trim()} {excelItem.one}/{excelItem.two.Trim()}/{excelItem.three.Trim()}"; + string remarks = ""; + if (!string.IsNullOrEmpty(excelItem.Remarks)) + { + remarks = excelItem.Remarks; + if (string.IsNullOrEmpty(excelItem.BusinessType)) + { + var t = remarks.Split(" "); + if (t.Length > 2) + { + excelItem.BusinessType = t[2]; + } + } + else + { + excelItem.BusinessType = remarks.Substring(0, 1); + } + } + else + { + remarks = $"{excelItem.YeWuMingCheng?.Trim()} {excelItem.EquipmentModel?.Trim()} {excelItem.BusinessType?.Trim()} {(!string.IsNullOrEmpty(excelItem.one) ? excelItem?.one + "/" : "")}{(!string.IsNullOrEmpty(excelItem.two?.Trim()) ? excelItem.two?.Trim() + "/" : "")}{excelItem.three?.Trim()}"; + remarks = remarks.Trim(); + } if (port == null) { port = new OdfPorts() diff --git a/ZR.Admin.WebApi/wwwroot/ImportTemplate/OdfPorts.xlsx b/ZR.Admin.WebApi/wwwroot/ImportTemplate/OdfPorts.xlsx index a3baaaa..ff628da 100644 Binary files a/ZR.Admin.WebApi/wwwroot/ImportTemplate/OdfPorts.xlsx and b/ZR.Admin.WebApi/wwwroot/ImportTemplate/OdfPorts.xlsx differ diff --git a/ZR.Model/Business/Dto/OdfPortsDto.cs b/ZR.Model/Business/Dto/OdfPortsDto.cs index 1769b71..5e3c7fd 100644 --- a/ZR.Model/Business/Dto/OdfPortsDto.cs +++ b/ZR.Model/Business/Dto/OdfPortsDto.cs @@ -417,9 +417,9 @@ namespace ZR.Model.Business.Dto [ExcelColumnName("连接状态,0断开,1连接")] public int Status { get; set; } - //[ExcelColumn(Name = "备注")] - //[ExcelColumnName("备注")] - //public string Remarks { get; set; } + [ExcelColumn(Name = "备注")] + [ExcelColumnName("备注")] + public string Remarks { get; set; } [ExcelColumn(Name = "光衰值(dB)")] [ExcelColumnName("光衰值(dB)")]