fix registry表只下载一次

This commit is contained in:
2025-04-02 17:24:29 +08:00
parent f227665aed
commit 4595aa3a05
2 changed files with 8 additions and 5 deletions

View File

@@ -8,11 +8,11 @@ using SqlSugar.DbConvert;
namespace Dlhis.Middle.Entities
{
[SugarTable(TableName = "Device")]
public class LocalDeviceEntity : SugarBaseEntity , ITenantId
public class LocalDeviceEntity : SugarBaseEntity, ITenantId
{
public new int Id { get; set; }
/// <summary>
/// <summary>
/// 设备code
/// </summary>
[SugarColumn(ColumnDescription = "设备code")]
@@ -58,7 +58,7 @@ namespace Dlhis.Middle.Entities
/// <summary>
/// 部署方向
/// </summary>
[SugarColumn(ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
[SugarColumn(IsNullable = true, ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))]
public DeviceDeployDirectionEnumType? DeployDirection { get; set; }
/// <summary>

View File

@@ -42,7 +42,10 @@ public class DataDownloadService : IDataDownloadService
}
await DownloadAsync<LocalDeviceEntity>(item);
await DownloadAsync<LocalDeviceRegistryEntity>(item);
if (!await _dbContext.Queryable<LocalDeviceRegistryEntity>().AnyAsync())
{
await DownloadAsync<LocalDeviceRegistryEntity>(item);
}
await DownloadAsync<LocalBusinessPlaceEntity>(item);
await DownloadAsync<LocalBusinessShiftEntity>(item);