diff --git a/Src/Dlhis.Middle/Entities/LocalDeviceEntity.cs b/Src/Dlhis.Middle/Entities/LocalDeviceEntity.cs index e3a9f833..e1c768ad 100644 --- a/Src/Dlhis.Middle/Entities/LocalDeviceEntity.cs +++ b/Src/Dlhis.Middle/Entities/LocalDeviceEntity.cs @@ -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; } - - /// + + /// /// 设备code /// [SugarColumn(ColumnDescription = "设备code")] @@ -58,7 +58,7 @@ namespace Dlhis.Middle.Entities /// /// 部署方向 /// - [SugarColumn(ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] + [SugarColumn(IsNullable = true, ColumnDescription = "部署方向", ColumnDataType = "varchar(50)", SqlParameterDbType = typeof(EnumToStringConvert))] public DeviceDeployDirectionEnumType? DeployDirection { get; set; } /// diff --git a/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs b/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs index 9f1e83bd..c57bdd0a 100644 --- a/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs +++ b/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs @@ -42,7 +42,10 @@ public class DataDownloadService : IDataDownloadService } await DownloadAsync(item); - await DownloadAsync(item); + if (!await _dbContext.Queryable().AnyAsync()) + { + await DownloadAsync(item); + } await DownloadAsync(item); await DownloadAsync(item);