feat(aihitMainSyncer): реализована логика синхронизации таблиц unit.* с данными из АИХ ИТ

This commit is contained in:
Mikhail Kuznetsov
2025-05-21 11:53:07 +10:00
parent 1ce8fcb284
commit 0fd0b4881f
13 changed files with 177 additions and 78 deletions

View File

@@ -20,18 +20,20 @@ namespace PARR.DAL.Services.Implementations.Unit
}
public async Task<Models.Unit.Unit?> GetUnitWithFieldsAsync(string name)
public async Task<Models.Unit.Unit?> GetUnitByName(string name)
{
return await GetUnitWithIncludeFields()
return await GetUnitWithFieldsAndValues()
.FirstOrDefaultAsync(u => u.Name.ToLower() == name.ToLower());
}
private IQueryable<Models.Unit.Unit> GetUnitWithIncludeFields()
private IQueryable<Models.Unit.Unit> GetUnitWithFieldsAndValues()
{
return EntitySet
.Include(t => t.UnitFields)
.ThenInclude(f => f.UnitField);
.Include(u => u.UnitFields)
.ThenInclude(f => f.UnitField)
.Include(u => u.UnitValues)
.ThenInclude(v => v.Value);
}
}
}