diff --git a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs index a0acdbc..1531883 100644 --- a/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs +++ b/Repository/BackendRepository/Implement/NiagaraDataSynchronizeRepository.cs @@ -271,11 +271,28 @@ namespace Repository.BackendRepository.Implement row.full_name + "'," + "0" + ");"); + + if (sb.Length >= 100) + { + using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) + { + await conn.ExecuteAsync(sb.ToString()); + } + + sb.Clear(); + } } var isDome = await GetOneAsync("select system_value from variable where deleted = 0 and system_type = 'project_name';"); if (sb.Length > 0) { + using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) + { + await conn.ExecuteAsync(sb.ToString()); + } + + sb.Clear(); + if (isDome.Contains("ibms_dome")) { sb.Append($@" update import_niagara_item a @@ -283,8 +300,15 @@ namespace Repository.BackendRepository.Implement join variable v1 on b.system_parent_id = v1.id set device_system_tag = v1.system_value where (device_system_tag <> 'S' and device_system_tag <> 'CWB' and device_system_tag <> 'B');"); + + using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) + { + await conn.ExecuteAsync(sb.ToString()); + } } + sb.Clear(); + sb.Append($@" update import_niagara_item set full_name = device_point_name where full_name = '' or full_name is null;"); using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) {