forked from ddrilling/AsbCloudServer
merge dev to .
This commit is contained in:
commit
2f052fada0
9399
AsbCloudDb/Migrations/20240415043251_Update_WellOperationName.Designer.cs
generated
Normal file
9399
AsbCloudDb/Migrations/20240415043251_Update_WellOperationName.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,32 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AsbCloudDb.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class Update_WellOperationName : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "t_well_operation_category",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: 5089,
|
||||||
|
column: "name",
|
||||||
|
value: "Спуск КО на транспортной колонне");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.UpdateData(
|
||||||
|
table: "t_well_operation_category",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: 5089,
|
||||||
|
column: "name",
|
||||||
|
value: "Спуск КО на транспотрной колонне");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -7269,7 +7269,7 @@ namespace AsbCloudDb.Migrations
|
|||||||
IsHidden = false,
|
IsHidden = false,
|
||||||
KeyValueName = "dT",
|
KeyValueName = "dT",
|
||||||
KeyValueUnits = "мин",
|
KeyValueUnits = "мин",
|
||||||
Name = "Спуск КО на транспотрной колонне"
|
Name = "Спуск КО на транспортной колонне"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
|
@ -370,7 +370,7 @@ namespace AsbCloudDb.Model
|
|||||||
new () {Id = 5086, IdParent = 4005, Name = "Подъем БИ с выбросом на мостки", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5086, IdParent = 4005, Name = "Подъем БИ с выбросом на мостки", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
new () {Id = 5087, IdParent = 4005, Name = "Спуск БИ со сборкой с мостков", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5087, IdParent = 4005, Name = "Спуск БИ со сборкой с мостков", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
new () {Id = 5088, IdParent = 4005, Name = "Сборка и спуск ТБТ", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5088, IdParent = 4005, Name = "Сборка и спуск ТБТ", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
new () {Id = 5089, IdParent = 4005, Name = "Спуск КО на транспотрной колонне", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5089, IdParent = 4005, Name = "Спуск КО на транспортной колонне", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
new () {Id = 5090, IdParent = 4008, Name = "Отворот допускной трубы", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5090, IdParent = 4008, Name = "Отворот допускной трубы", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
new () {Id = 5091, IdParent = 4008, Name = "Активация подвески, опрессовка", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5091, IdParent = 4008, Name = "Активация подвески, опрессовка", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
new () {Id = 5092, IdParent = 4008, Name = "Монтаж, опрессовка ФА", KeyValueName = "dT", KeyValueUnits = "мин" },
|
new () {Id = 5092, IdParent = 4008, Name = "Монтаж, опрессовка ФА", KeyValueName = "dT", KeyValueUnits = "мин" },
|
||||||
|
@ -142,11 +142,9 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
if (ids.Length != existingEntitiesCount)
|
if (ids.Length != existingEntitiesCount)
|
||||||
throw new ArgumentInvalidException(nameof(dtos), "Все записи должны существовать в БД");
|
throw new ArgumentInvalidException(nameof(dtos), "Все записи должны существовать в БД");
|
||||||
|
|
||||||
var entities = dtos.Select(Convert);
|
var entities = dbContext.Set<TEntity>().Where(e => ids.Contains(e.Id));
|
||||||
var entries = entities.Select(entity => dbSet.Update(entity)).Cast<EntityEntry>().ToList();
|
dbContext.Set<TEntity>().UpdateRange(entities);
|
||||||
var affected = await dbContext.SaveChangesAsync(token);
|
return await dbContext.SaveChangesAsync(token);
|
||||||
entries.ForEach(e => e.State = EntityState.Detached);
|
|
||||||
return affected;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
@ -50,7 +50,7 @@ public class WellOperationParser<TTemplateParameters> : ExcelWellRelatedParser<W
|
|||||||
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
|
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
|
||||||
TemplateParameters.SheetName,
|
TemplateParameters.SheetName,
|
||||||
rowNumber,
|
rowNumber,
|
||||||
TemplateParameters.Cells[nameof(WellOperationDto.WellSectionTypeCaption)],
|
TemplateParameters.Cells[nameof(WellOperationDto.WellSectionTypeCaption)].ColumnNumber,
|
||||||
"Указана некорректная секция");
|
"Указана некорректная секция");
|
||||||
throw new FileFormatException(message);
|
throw new FileFormatException(message);
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ public class WellOperationParser<TTemplateParameters> : ExcelWellRelatedParser<W
|
|||||||
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
|
var message = string.Format(XLExtentions.ProblemDetailsTemplate,
|
||||||
TemplateParameters.SheetName,
|
TemplateParameters.SheetName,
|
||||||
rowNumber,
|
rowNumber,
|
||||||
TemplateParameters.Cells[nameof(WellOperationDto.OperationCategoryName)],
|
TemplateParameters.Cells[nameof(WellOperationDto.OperationCategoryName)].ColumnNumber,
|
||||||
"Указана некорректная операция");
|
"Указана некорректная операция");
|
||||||
throw new FileFormatException(message);
|
throw new FileFormatException(message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user