change:
1.修改歷史紀錄左方下拉選單判斷 device visible = 1 2.後端同步判斷table Device fullName為空,以device_number替代
This commit is contained in:
parent
addc1ac851
commit
f6dffd0ef3
@ -82,6 +82,7 @@ namespace Backend.Controllers
|
||||
var building = ds.FirstOrDefault().building;
|
||||
await niagaraDataSynchronizeRepository.InsertNiagaraTagList(ds, building);
|
||||
await niagaraDataSynchronizeRepository.DeviceComparison();
|
||||
await niagaraDataSynchronizeRepository.CheckFullNameEmptyReplaceByDeviceName();
|
||||
await niagaraDataSynchronizeRepository.InsertBuildingMenu();
|
||||
await niagaraDataSynchronizeRepository.InsertSubSystemFloor();
|
||||
result = true;
|
||||
|
@ -204,7 +204,7 @@ namespace FrontendWebApi.ApiControllers
|
||||
join userinfo c on c.role_guid = a.role_guid
|
||||
join variable v2 on b.ShowView = v2.id and v2.system_type = @sub_system_type
|
||||
join variable v1 on v1.id = v2.system_parent_id and v1.system_type = @main_system_type
|
||||
join device d on v1.system_value = d.device_system_tag and v2.system_value = d.device_name_tag and d.deleted = 0
|
||||
join device d on v1.system_value = d.device_system_tag and v2.system_value = d.device_name_tag and d.deleted = 0 and d.visible = 1
|
||||
where c.account = @account
|
||||
order by v1.system_priority, v2.system_priority", new { @account = myUser.account, @sub_system_type = sub_system_type, @main_system_type = main_system_type });
|
||||
var dbbuilding = await frontendRepository.GetAllAsync<History_Build>(
|
||||
|
@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using Repository.Models;
|
||||
using System.Data.SqlTypes;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
namespace Repository.BackendRepository.Implement
|
||||
{
|
||||
@ -223,7 +224,7 @@ namespace Repository.BackendRepository.Implement
|
||||
data.device_building_tag + "', '" +
|
||||
data.device_system_tag + "', '" +
|
||||
data.device_name_tag + "', '" +
|
||||
data.device_full_name + "', '" +
|
||||
data.device_full_name + "', '" +
|
||||
data.device_floor_tag + "', '" +
|
||||
data.device_master_tag + "', '" +
|
||||
data.device_last_name_tag + "', '" +
|
||||
@ -505,6 +506,34 @@ namespace Repository.BackendRepository.Implement
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 檢查device內FullName為空的值,以device_Name取代
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task CheckFullNameEmptyReplaceByDeviceName()
|
||||
{
|
||||
using (IDbConnection conn = GetDbConnection())
|
||||
{
|
||||
conn.Open();
|
||||
using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
|
||||
{
|
||||
try
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("update bims_mitsubishi.device set full_name=device_number where full_Name='';");
|
||||
await conn.ExecuteAsync(sb.ToString());
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
throw exception;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,12 @@ namespace Repository.BackendRepository.Interface
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task DeviceComparison();
|
||||
|
||||
/// <summary>
|
||||
/// 比對 device的FullName,若為空則以DeviceName取代
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task CheckFullNameEmptyReplaceByDeviceName();
|
||||
/// <summary>
|
||||
/// 比對 device_item
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user