forked from ddrilling/AsbCloudServer
#5998816 edit result dto
This commit is contained in:
parent
de54067344
commit
7fda09f617
26
AsbCloudApp/Data/WellCaseDto.cs
Normal file
26
AsbCloudApp/Data/WellCaseDto.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AsbCloudApp.Data
|
||||
{
|
||||
#nullable enable
|
||||
/// <summary>
|
||||
/// Дела скважины
|
||||
/// </summary>
|
||||
public class WellCaseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Скважина
|
||||
/// </summary>
|
||||
public int IdWell { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Документ дела скважины
|
||||
/// </summary>
|
||||
public IEnumerable<WellFinalDocumentDto> WellFinalDocuments { get; set; } = Enumerable.Empty<WellFinalDocumentDto>();
|
||||
}
|
||||
#nullable disable
|
||||
}
|
@ -9,11 +9,6 @@ namespace AsbCloudApp.Data
|
||||
/// </summary>
|
||||
public class WellFinalDocumentDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Скважина
|
||||
/// </summary>
|
||||
public int IdWell { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Наименование категории файла
|
||||
/// </summary>
|
||||
|
@ -27,7 +27,7 @@ namespace AsbCloudApp.Services
|
||||
/// <param name = "idWell" ></param >
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
Task<IEnumerable<WellFinalDocumentDto>> GetByWellId(int idWell, CancellationToken token);
|
||||
Task<WellCaseDto> GetByWellId(int idWell, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
/// Получение списка ответственных
|
||||
|
@ -77,9 +77,9 @@ namespace AsbCloudInfrastructure.Services
|
||||
throw new ArgumentInvalidException("Данные по категориям отсутствуют.");
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<WellFinalDocumentDto>> GetByWellId(int idWell, CancellationToken token)
|
||||
public async Task<WellCaseDto> GetByWellId(int idWell, CancellationToken token)
|
||||
{
|
||||
var result = new List<WellFinalDocumentDto>();
|
||||
var wellFinalDocuments = new List<WellFinalDocumentDto>();
|
||||
|
||||
var wells = await context.WellFinalDocuments.Where(x => x.IdWell == idWell)
|
||||
.ToListAsync(token)
|
||||
@ -121,8 +121,8 @@ namespace AsbCloudInfrastructure.Services
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
result.Add(new WellFinalDocumentDto {
|
||||
IdWell = idWell,
|
||||
wellFinalDocuments.Add(new WellFinalDocumentDto {
|
||||
|
||||
NameCategory = item.NameCategory,
|
||||
Publishers = allUsers.Where(x => userIds.Contains(x.Id)),
|
||||
FilesCount = allFiles.Count(),
|
||||
@ -131,7 +131,10 @@ namespace AsbCloudInfrastructure.Services
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
return new WellCaseDto {
|
||||
IdWell = idWell,
|
||||
WellFinalDocuments = wellFinalDocuments
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<UserDto>> GetAvailableUsersAsync(int idWell, CancellationToken token)
|
||||
|
Loading…
Reference in New Issue
Block a user