Merge branch 'dev' into feature/daily_report

This commit is contained in:
commit d2beb250d6
13 changed files with 8759 additions and 77 deletions

View File

@ -14,4 +14,9 @@ public class WellSectionTypeDto : IId
/// Название типа секции
/// </summary>
public string Caption { get; set; } = null!;
/// <summary>
/// Порядок
/// </summary>
public int Order { get; set; }
}

View File

@ -22,7 +22,7 @@ namespace AsbCloudApp.Repositories
/// Список секций
/// </summary>
/// <returns></returns>
IDictionary<int, string> GetSectionTypes();
IEnumerable<WellSectionTypeDto> GetSectionTypes();
/// <summary>
/// список плановых операций для сопоставления

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,251 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class Add_Order_For_SectionType : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<float>(
name: "order",
table: "t_well_section_type",
type: "real",
nullable: false,
defaultValue: 0f,
comment: "Порядок");
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 1,
column: "order",
value: 4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 3,
column: "order",
value: 1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 4,
column: "order",
value: 3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 5,
column: "order",
value: 5f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 6,
column: "order",
value: 6f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 7,
column: "order",
value: 4.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 8,
column: "order",
value: 0.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 9,
column: "order",
value: 1.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 10,
column: "order",
value: 3.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 11,
column: "order",
value: 5.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 12,
column: "order",
value: 6.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 13,
column: "order",
value: 4.2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 14,
column: "order",
value: 0.2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 15,
column: "order",
value: 1.2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 16,
column: "order",
value: 3.2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 17,
column: "order",
value: 5.2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 18,
column: "order",
value: 6.2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 19,
column: "order",
value: 4.3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 20,
column: "order",
value: 0.3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 21,
column: "order",
value: 1.3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 22,
column: "order",
value: 3.3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 23,
column: "order",
value: 5.3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 24,
column: "order",
value: 6.3f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 25,
column: "order",
value: 4.4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 26,
column: "order",
value: 0.4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 27,
column: "order",
value: 1.4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 28,
column: "order",
value: 3.4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 29,
column: "order",
value: 5.4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 30,
column: "order",
value: 6.4f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 31,
column: "order",
value: 2f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 32,
column: "order",
value: 2.1f);
migrationBuilder.UpdateData(
table: "t_well_section_type",
keyColumn: "id",
keyValue: 33,
column: "order",
value: 2.2f);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "order",
table: "t_well_section_type");
}
}
}

View File

@ -6539,6 +6539,11 @@ namespace AsbCloudDb.Migrations
.HasColumnName("caption")
.HasComment("Название");
b.Property<float>("Order")
.HasColumnType("real")
.HasColumnName("order")
.HasComment("Порядок");
b.HasKey("Id");
b.ToTable("t_well_section_type");
@ -6549,167 +6554,200 @@ namespace AsbCloudDb.Migrations
new
{
Id = 1,
Caption = "Пилотный ствол"
Caption = "Пилотный ствол",
Order = 4f
},
new
{
Id = 2,
Caption = "Направление"
Caption = "Направление",
Order = 0f
},
new
{
Id = 3,
Caption = "Кондуктор"
Caption = "Кондуктор",
Order = 1f
},
new
{
Id = 4,
Caption = "Эксплуатационная колонна"
Caption = "Эксплуатационная колонна",
Order = 3f
},
new
{
Id = 5,
Caption = "Транспортный ствол"
Caption = "Транспортный ствол",
Order = 5f
},
new
{
Id = 6,
Caption = "Хвостовик"
Caption = "Хвостовик",
Order = 6f
},
new
{
Id = 7,
Caption = "Пилотный ствол 2"
Caption = "Пилотный ствол 2",
Order = 4.1f
},
new
{
Id = 8,
Caption = "Направление 2"
Caption = "Направление 2",
Order = 0.1f
},
new
{
Id = 9,
Caption = "Кондуктор 2"
Caption = "Кондуктор 2",
Order = 1.1f
},
new
{
Id = 10,
Caption = "Эксплуатационная колонна 2"
Caption = "Эксплуатационная колонна 2",
Order = 3.1f
},
new
{
Id = 11,
Caption = "Транспортный ствол 2"
Caption = "Транспортный ствол 2",
Order = 5.1f
},
new
{
Id = 12,
Caption = "Хвостовик 2"
Caption = "Хвостовик 2",
Order = 6.1f
},
new
{
Id = 13,
Caption = "Пилотный ствол 3"
Caption = "Пилотный ствол 3",
Order = 4.2f
},
new
{
Id = 14,
Caption = "Направление 3"
Caption = "Направление 3",
Order = 0.2f
},
new
{
Id = 15,
Caption = "Кондуктор 3"
Caption = "Кондуктор 3",
Order = 1.2f
},
new
{
Id = 16,
Caption = "Эксплуатационная колонна 3"
Caption = "Эксплуатационная колонна 3",
Order = 3.2f
},
new
{
Id = 17,
Caption = "Транспортный ствол 3"
Caption = "Транспортный ствол 3",
Order = 5.2f
},
new
{
Id = 18,
Caption = "Хвостовик 3"
Caption = "Хвостовик 3",
Order = 6.2f
},
new
{
Id = 19,
Caption = "Пилотный ствол 4"
Caption = "Пилотный ствол 4",
Order = 4.3f
},
new
{
Id = 20,
Caption = "Направление 4"
Caption = "Направление 4",
Order = 0.3f
},
new
{
Id = 21,
Caption = "Кондуктор 4"
Caption = "Кондуктор 4",
Order = 1.3f
},
new
{
Id = 22,
Caption = "Эксплуатационная колонна 4"
Caption = "Эксплуатационная колонна 4",
Order = 3.3f
},
new
{
Id = 23,
Caption = "Транспортный ствол 4"
Caption = "Транспортный ствол 4",
Order = 5.3f
},
new
{
Id = 24,
Caption = "Хвостовик 4"
Caption = "Хвостовик 4",
Order = 6.3f
},
new
{
Id = 25,
Caption = "Пилотный ствол 5"
Caption = "Пилотный ствол 5",
Order = 4.4f
},
new
{
Id = 26,
Caption = "Направление 5"
Caption = "Направление 5",
Order = 0.4f
},
new
{
Id = 27,
Caption = "Кондуктор 5"
Caption = "Кондуктор 5",
Order = 1.4f
},
new
{
Id = 28,
Caption = "Эксплуатационная колонна 5"
Caption = "Эксплуатационная колонна 5",
Order = 3.4f
},
new
{
Id = 29,
Caption = "Транспортный ствол 5"
Caption = "Транспортный ствол 5",
Order = 5.4f
},
new
{
Id = 30,
Caption = "Хвостовик 5"
Caption = "Хвостовик 5",
Order = 6.4f
},
new
{
Id = 31,
Caption = "Техническая колонна"
Caption = "Техническая колонна",
Order = 2f
},
new
{
Id = 32,
Caption = "Техническая колонна 2"
Caption = "Техническая колонна 2",
Order = 2.1f
},
new
{
Id = 33,
Caption = "Техническая колонна 3"
Caption = "Техническая колонна 3",
Order = 2.2f
});
});

View File

@ -4,44 +4,44 @@
{
public override WellSectionType[] GetData() => new WellSectionType[]
{
new (){ Id = 1, Caption = "Пилотный ствол"},
new (){ Id = 2, Caption = "Направление"},
new (){ Id = 3, Caption = "Кондуктор"},
new (){ Id = 4, Caption = "Эксплуатационная колонна"},
new (){ Id = 5, Caption = "Транспортный ствол"},
new (){ Id = 6, Caption = "Хвостовик"},
new (){ Id = 1, Caption = "Пилотный ствол", Order = 4},
new (){ Id = 2, Caption = "Направление", Order = 0},
new (){ Id = 3, Caption = "Кондуктор", Order = 1},
new (){ Id = 4, Caption = "Эксплуатационная колонна", Order = 3},
new (){ Id = 5, Caption = "Транспортный ствол", Order = 5},
new (){ Id = 6, Caption = "Хвостовик", Order = 6},
new (){ Id = 7, Caption = "Пилотный ствол 2"},
new (){ Id = 8, Caption = "Направление 2"},
new (){ Id = 9, Caption = "Кондуктор 2"},
new (){ Id = 10, Caption = "Эксплуатационная колонна 2"},
new (){ Id = 11, Caption = "Транспортный ствол 2"},
new (){ Id = 12, Caption = "Хвостовик 2"},
new (){ Id = 7, Caption = "Пилотный ствол 2", Order = 4.1f},
new (){ Id = 8, Caption = "Направление 2", Order = 0.1f},
new (){ Id = 9, Caption = "Кондуктор 2", Order = 1.1f},
new (){ Id = 10, Caption = "Эксплуатационная колонна 2", Order = 3.1f},
new (){ Id = 11, Caption = "Транспортный ствол 2", Order = 5.1f},
new (){ Id = 12, Caption = "Хвостовик 2", Order = 6.1f},
new (){ Id = 13, Caption = "Пилотный ствол 3"},
new (){ Id = 14, Caption = "Направление 3"},
new (){ Id = 15, Caption = "Кондуктор 3"},
new (){ Id = 16, Caption = "Эксплуатационная колонна 3"},
new (){ Id = 17, Caption = "Транспортный ствол 3"},
new (){ Id = 18, Caption = "Хвостовик 3"},
new (){ Id = 13, Caption = "Пилотный ствол 3", Order = 4.2f},
new (){ Id = 14, Caption = "Направление 3", Order = 0.2f},
new (){ Id = 15, Caption = "Кондуктор 3", Order = 1.2f},
new (){ Id = 16, Caption = "Эксплуатационная колонна 3", Order = 3.2f},
new (){ Id = 17, Caption = "Транспортный ствол 3", Order = 5.2f},
new (){ Id = 18, Caption = "Хвостовик 3", Order = 6.2f},
new (){ Id = 19, Caption = "Пилотный ствол 4"},
new (){ Id = 20, Caption = "Направление 4"},
new (){ Id = 21, Caption = "Кондуктор 4"},
new (){ Id = 22, Caption = "Эксплуатационная колонна 4"},
new (){ Id = 23, Caption = "Транспортный ствол 4"},
new (){ Id = 24, Caption = "Хвостовик 4"},
new (){ Id = 19, Caption = "Пилотный ствол 4", Order = 4.3f},
new (){ Id = 20, Caption = "Направление 4", Order = 0.3f},
new (){ Id = 21, Caption = "Кондуктор 4", Order = 1.3f},
new (){ Id = 22, Caption = "Эксплуатационная колонна 4", Order = 3.3f},
new (){ Id = 23, Caption = "Транспортный ствол 4", Order = 5.3f},
new (){ Id = 24, Caption = "Хвостовик 4", Order = 6.3f},
new (){ Id = 25, Caption = "Пилотный ствол 5"},
new (){ Id = 26, Caption = "Направление 5"},
new (){ Id = 27, Caption = "Кондуктор 5"},
new (){ Id = 28, Caption = "Эксплуатационная колонна 5"},
new (){ Id = 29, Caption = "Транспортный ствол 5"},
new (){ Id = 30, Caption = "Хвостовик 5"},
new (){ Id = 25, Caption = "Пилотный ствол 5", Order = 4.4f},
new (){ Id = 26, Caption = "Направление 5", Order = 0.4f},
new (){ Id = 27, Caption = "Кондуктор 5", Order = 1.4f},
new (){ Id = 28, Caption = "Эксплуатационная колонна 5", Order = 3.4f},
new (){ Id = 29, Caption = "Транспортный ствол 5", Order = 5.4f},
new (){ Id = 30, Caption = "Хвостовик 5", Order = 6.4f},
new (){ Id = 31, Caption = "Техническая колонна"},
new (){ Id = 32, Caption = "Техническая колонна 2"},
new (){ Id = 33, Caption = "Техническая колонна 3"},
new (){ Id = 31, Caption = "Техническая колонна", Order = 2},
new (){ Id = 32, Caption = "Техническая колонна 2", Order = 2.1f},
new (){ Id = 33, Caption = "Техническая колонна 3", Order = 2.2f},
};
}
}

View File

@ -17,6 +17,9 @@ namespace AsbCloudDb.Model
[StringLength(255)]
public string Caption { get; set; } = string.Empty;
[Column("order"), Comment("Порядок")]
public float Order { get; set; }
[JsonIgnore]
[InverseProperty(nameof(WellOperation.WellSectionType))]
public virtual ICollection<WellOperation> WellOperations { get; set; } = null!;

View File

@ -57,10 +57,13 @@ namespace AsbCloudInfrastructure.Repository
}
/// <inheritdoc/>
public IDictionary<int, string> GetSectionTypes()
=> memoryCache
.GetOrCreateBasic(db.Set<WellSectionType>())
.ToDictionary(s => s.Id, s => s.Caption);
public IEnumerable<WellSectionTypeDto> GetSectionTypes() =>
memoryCache
.GetOrCreateBasic(db.Set<WellSectionType>())
.OrderBy(s => s.Order)
.Select(s => s.Adapt<WellSectionTypeDto>());
public async Task<WellOperationPlanDto> GetOperationsPlanAsync(int idWell, DateTime? currentDate, CancellationToken token)
{

View File

@ -64,7 +64,9 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
if (telemetryIndexStart < 0)
return Enumerable.Empty<ProcessMapReportDto>();
IDictionary<int, string> sectionTypes = wellOperationRepository.GetSectionTypes();
IDictionary<int, string> sectionTypes = wellOperationRepository
.GetSectionTypes()
.ToDictionary(s => s.Id, s => s.Caption);
foreach (var interval in processMapIntervals)
{

View File

@ -23,7 +23,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
private readonly ITelemetryDataService<TDto> telemetryDataService;
private readonly IHubContext<TelemetryHub> telemetryHubContext;
public string SirnalRMethodGetDataName { get; protected set; } = "ReceiveData";
public string SignalRMethodGetDataName { get; protected set; } = "ReceiveData";
public TelemetryDataBaseController(
ITelemetryService telemetryService,
@ -55,7 +55,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
var idWell = telemetryService.GetIdWellByTelemetryUid(uid);
if (idWell is not null && dtos.Any())
_ = Task.Run(() => telemetryHubContext.Clients.Group($"well_{idWell}")
.SendAsync(SirnalRMethodGetDataName, dtos), CancellationToken.None);
.SendAsync(SignalRMethodGetDataName, dtos), CancellationToken.None);
return Ok();
}

View File

@ -31,7 +31,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
wellService,
telemetryHubContext)
{
SirnalRMethodGetDataName = "ReceiveDataSaub";
SignalRMethodGetDataName = "ReceiveDataSaub";
telemetryDataSaubService = telemetryDataService;
}

View File

@ -24,7 +24,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
wellService,
telemetryHubContext)
{
SirnalRMethodGetDataName = "ReceiveDataSpin";
SignalRMethodGetDataName = "ReceiveDataSpin";
}
}
}

View File

@ -43,7 +43,7 @@ namespace AsbCloudWebApi.Controllers
[HttpGet]
[Route("sectionTypes")]
[Permission]
[ProducesResponseType(typeof(IDictionary<int, string>), (int)System.Net.HttpStatusCode.OK)]
[ProducesResponseType(typeof(IEnumerable<WellSectionTypeDto>), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetSectionTypes()
{
var result = operationRepository.GetSectionTypes();