Merge branch 'dev' into convertToPdf

This commit is contained in:
Никита Фролов 2023-01-18 13:58:25 +05:00
commit 219fe450a1
7 changed files with 7111 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
public partial class AddPermissions_wireline_plannedTrajectory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "t_permission",
columns: new[] { "id", "description", "name" },
values: new object[,]
{
{ 507, "Разрешение просматривать наработка талевого каната", "TelemetryWirelineRunOut.get" },
{ 510, "Разрешение просматривать плановая траектория", "TelemetryWirelineRunOut.get" },
{ 511, "Разрешение редактировать плановая траектория", "TelemetryWirelineRunOut.edit" },
{ 512, "Разрешение удалять плановая траектория", "TelemetryWirelineRunOut.delete" }
});
migrationBuilder.InsertData(
table: "t_relation_user_role_permission",
columns: new[] { "id_permission", "id_user_role" },
values: new object[,]
{
{ 510, 1 },
{ 511, 1 },
{ 512, 1 },
{ 507, 1500 },
{ 510, 1500 }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_relation_user_role_permission",
keyColumns: new[] { "id_permission", "id_user_role" },
keyValues: new object[] { 510, 1 });
migrationBuilder.DeleteData(
table: "t_relation_user_role_permission",
keyColumns: new[] { "id_permission", "id_user_role" },
keyValues: new object[] { 511, 1 });
migrationBuilder.DeleteData(
table: "t_relation_user_role_permission",
keyColumns: new[] { "id_permission", "id_user_role" },
keyValues: new object[] { 512, 1 });
migrationBuilder.DeleteData(
table: "t_relation_user_role_permission",
keyColumns: new[] { "id_permission", "id_user_role" },
keyValues: new object[] { 507, 1500 });
migrationBuilder.DeleteData(
table: "t_relation_user_role_permission",
keyColumns: new[] { "id_permission", "id_user_role" },
keyValues: new object[] { 510, 1500 });
migrationBuilder.DeleteData(
table: "t_permission",
keyColumn: "id",
keyValue: 507);
migrationBuilder.DeleteData(
table: "t_permission",
keyColumn: "id",
keyValue: 510);
migrationBuilder.DeleteData(
table: "t_permission",
keyColumn: "id",
keyValue: 511);
migrationBuilder.DeleteData(
table: "t_permission",
keyColumn: "id",
keyValue: 512);
}
}
}

View File

@ -1759,6 +1759,30 @@ namespace AsbCloudDb.Migrations
Id = 506,
Description = "Разрешение редактировать ответственных за загрузку файла Дело скважины",
Name = "WellFinalDocuments.editPublisher"
},
new
{
Id = 507,
Description = "Разрешение просматривать наработка талевого каната",
Name = "TelemetryWirelineRunOut.get"
},
new
{
Id = 510,
Description = "Разрешение просматривать плановая траектория",
Name = "TelemetryWirelineRunOut.get"
},
new
{
Id = 511,
Description = "Разрешение редактировать плановая траектория",
Name = "TelemetryWirelineRunOut.edit"
},
new
{
Id = 512,
Description = "Разрешение удалять плановая траектория",
Name = "TelemetryWirelineRunOut.delete"
});
});
@ -2451,6 +2475,16 @@ namespace AsbCloudDb.Migrations
IdPermission = 234
},
new
{
IdUserRole = 1500,
IdPermission = 507
},
new
{
IdUserRole = 1500,
IdPermission = 510
},
new
{
IdUserRole = 1501,
IdPermission = 214
@ -2629,6 +2663,26 @@ namespace AsbCloudDb.Migrations
{
IdUserRole = 1,
IdPermission = 505
},
new
{
IdUserRole = 1,
IdPermission = 506
},
new
{
IdUserRole = 1,
IdPermission = 510
},
new
{
IdUserRole = 1,
IdPermission = 511
},
new
{
IdUserRole = 1,
IdPermission = 512
});
});
@ -3670,7 +3724,7 @@ namespace AsbCloudDb.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("IdTelemetry"));
b.Property<DateTime>("DateTime")
b.Property<DateTimeOffset>("DateTime")
.HasColumnType("timestamp with time zone")
.HasColumnName("date_time")
.HasComment("Отметка времени");

View File

@ -135,6 +135,12 @@
new (){ Id = 504, Name="WellFinalDocuments.edit", Description="Разрешение редактировать Дело скважины"},
new (){ Id = 505, Name="WellFinalDocuments.get", Description="Разрешение просматривать Дело скважины"},
new (){ Id = 506, Name="WellFinalDocuments.editPublisher", Description="Разрешение редактировать ответственных за загрузку файла Дело скважины"},
new (){ Id = 507, Name="TelemetryWirelineRunOut.get", Description="Разрешение просматривать наработка талевого каната"},
new (){ Id = 510, Name="TelemetryWirelineRunOut.get", Description="Разрешение просматривать плановая траектория"},
new (){ Id = 511, Name="TelemetryWirelineRunOut.edit", Description="Разрешение редактировать плановая траектория"},
new (){ Id = 512, Name="TelemetryWirelineRunOut.delete", Description="Разрешение удалять плановая траектория"},
};
}
}

View File

@ -43,6 +43,7 @@
new (){ IdUserRole = 1219, IdPermission = 203}, new (){ IdUserRole = 1219, IdPermission = 206}, new (){ IdUserRole = 1219, IdPermission = 230}, new (){ IdUserRole = 1219, IdPermission = 232},
new (){ IdUserRole = 1220, IdPermission = 203}, new (){ IdUserRole = 1220, IdPermission = 228},
new (){ IdUserRole = 1221, IdPermission = 202}, new (){ IdUserRole = 1221, IdPermission = 203}, new (){ IdUserRole = 1221, IdPermission = 220}, new (){ IdUserRole = 1221, IdPermission = 234},
new (){ IdUserRole = 1500, IdPermission = 507}, new (){ IdUserRole = 1500, IdPermission = 510},
new (){ IdUserRole = 1501, IdPermission = 214}, new (){ IdUserRole = 1501, IdPermission = 213},
new (){ IdUserRole = 1502, IdPermission = 207}, new (){ IdUserRole = 1502, IdPermission = 208},
new (){ IdUserRole = 2000, IdPermission = 205}, new (){ IdUserRole = 2000, IdPermission = 204}, new (){ IdUserRole = 2000, IdPermission = 245},
@ -53,7 +54,7 @@
new (){ IdUserRole = 2005, IdPermission = 247}, new (){ IdUserRole = 2005, IdPermission = 205}, new (){ IdUserRole = 2005, IdPermission = 204},
new (){ IdUserRole = 2006, IdPermission = 243}, new (){ IdUserRole = 2006, IdPermission = 205}, new (){ IdUserRole = 2006, IdPermission = 204},
new (){ IdUserRole = 2007, IdPermission = 241}, new (){ IdUserRole = 2007, IdPermission = 205}, new (){ IdUserRole = 2007, IdPermission = 204},
new (){ IdUserRole = 1, IdPermission = 500}, new (){ IdUserRole = 1, IdPermission = 501}, new (){ IdUserRole = 1, IdPermission = 502}, new (){ IdUserRole = 1, IdPermission = 503}, new (){ IdUserRole = 1, IdPermission = 504}, new (){ IdUserRole = 1, IdPermission = 505},
new (){ IdUserRole = 1, IdPermission = 500}, new (){ IdUserRole = 1, IdPermission = 501}, new (){ IdUserRole = 1, IdPermission = 502}, new (){ IdUserRole = 1, IdPermission = 503}, new (){ IdUserRole = 1, IdPermission = 504}, new (){ IdUserRole = 1, IdPermission = 505}, new (){ IdUserRole = 1, IdPermission = 506}, new (){ IdUserRole = 1, IdPermission = 510}, new (){ IdUserRole = 1, IdPermission = 511}, new (){ IdUserRole = 1, IdPermission = 512},
};
}
}

View File

@ -283,7 +283,7 @@ namespace AsbCloudInfrastructure.Repository
.Where(subOp => subOp.IdType == o.IdType)
.Where(subOp => subOp.DateStart <= o.DateStart)
.Min(subOp => subOp.DateStart))
.TotalHours,
.TotalDays,
});
if (request.OperationType.HasValue)

View File

@ -95,6 +95,7 @@ namespace AsbCloudWebApi.Controllers.SAUB
}
[HttpGet]
[Permission]
public async Task<ActionResult<IEnumerable<TelemetryWirelineRunOutDto>>> GetAllAsync(CancellationToken token)
{
int? idCompany = User.GetCompanyId();