diff --git a/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs b/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs index a518bf71..baad1702 100644 --- a/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs +++ b/Src/Dlhis.Middle/Services/Implements/DataDownloadService.cs @@ -50,14 +50,17 @@ public class DataDownloadService : IDataDownloadService await DownloadAsync(item); - if (!await _dbContext.Queryable().AnyAsync()) + if (!await _dbContext.Queryable().Where(x => x.Factory == item).AnyAsync()) { await DownloadAsync(item); } if (!await _dbContext.Queryable().AnyAsync()) { - await DownloadAsync(item); + foreach (var currentItem in factories) + { + await DownloadAsync(currentItem); + } } } }