public async Task <StatementDetailDto> GetDetailAsync(long id) { var statement = await _statementRepo.GetAsync(id); var dto = MapToDto <StatementDetailDto>(statement); var assetDto = await _assetRepo.GetAssetParentAsync(dto.AssetId); var categoryDto = await _categoryRepo.GetCategoryParentAsync(dto.CategoryId); dto.assetParentName = assetDto?.Name; dto.categoryParentName = categoryDto?.Name; return(dto); }
public async Task <AssetDto> GetAsync(long id) { var asset = await _assetRepo.GetAssetParentAsync(id) ?? throw new KnownException("资产信息不存在或已删除!", ServiceResultCode.NotFound); return(_mapeer.Map <AssetDto>(asset)); }