diff --git a/Backend/Services/Implement/webRequestService.cs b/Backend/Services/Implement/webRequestService.cs index 2528ae5..96e0630 100644 --- a/Backend/Services/Implement/webRequestService.cs +++ b/Backend/Services/Implement/webRequestService.cs @@ -20,6 +20,7 @@ using NPOI.SS.Formula.Functions; using Microsoft.AspNetCore.Localization; using MySqlX.XDevAPI.Relational; using Backend.Models; +using NPOI.OpenXmlFormats.Dml; namespace Backend.Services.Implement { @@ -263,9 +264,12 @@ namespace Backend.Services.Implement row.parent_path = stationName; //full_name 其實是點位名稱 point_name - row.full_name = conPoint.Where(x => x.name.Contains(tagName.Replace('_', '/')) && !x.isHistory).Select(x => x.displayName).FirstOrDefault(); - if (conPoint.Where(x => x.name.Contains(tagName.Replace('_', '/')) && !x.isHistory).FirstOrDefault() != null) - conPoint.Where(x => x.name.Contains(tagName.Replace('_', '/')) && !x.isHistory).FirstOrDefault().isHistory = true; + var deviceNumber = tagName.Substring(0, tagName.LastIndexOf(tagName.Split("_")[5]) - 1); + var point = tagName.Split("_")[5]; + conPoint = conPoint.Where(x => x.name.Split("/").Length > 6).ToList(); + row.full_name = conPoint.Where(x => x.name.Split("/")[5] == deviceNumber && x.name.Split("/")[6] == point && !x.isHistory).Select(x => x.displayName).FirstOrDefault(); + if (conPoint.Where(x => x.name.Split("/")[5] == deviceNumber && x.name.Split("/")[6] == point && !x.isHistory).FirstOrDefault() != null) + conPoint.Where(x => x.name.Split("/")[5] == deviceNumber && x.name.Split("/")[6] == point && !x.isHistory).FirstOrDefault().isHistory = true; row.isHistory = true; result.Add(row); } diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index 1f2824e..ebf60a8 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -244,7 +244,7 @@ namespace Repository.BackendRepository.Implement var isDome = await GetOneAsync("select system_value from variable where deleted = 0 and system_type = 'project_name';"); if (sb.Length > 0) { - if (isDome == "ibms_dome_dome/D2") + if (isDome == "ibms_dome_dome/D2" || isDome == "ibms_dome_hotel/H") { sb.Append($@" update import_niagara_item a join dic_system b on a.device_name_tag COLLATE utf8mb4_general_ci = b.s2_code