Изменена таблица AppInWorks. Обновлен респонс шаблонов.
This commit is contained in:
@@ -12,6 +12,11 @@
|
||||
|
||||
public int StatusCode { get; set; }
|
||||
|
||||
public required string ShortDescription { get; set; }
|
||||
public required string FullDescription { get; set; }
|
||||
public required string Solution { get; set; }
|
||||
public required string TemplateDuration { get; set; }
|
||||
|
||||
//work
|
||||
//public required string Title { get; set; }
|
||||
//public required string SlaInterval { get; set; }
|
||||
|
||||
@@ -9,13 +9,5 @@
|
||||
public int EsppId { get; set; }
|
||||
|
||||
public Guid TnkId { get; set; }
|
||||
|
||||
public required string TemplateDuration { get; set; }
|
||||
|
||||
public required string ShortDescription { get; set; }
|
||||
|
||||
public required string FullDescription { get; set; }
|
||||
|
||||
public required string Solution { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,20 +34,24 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.Process, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Tnk!.Subprocess!.Process))
|
||||
.ForMember(d => d.Subprocess, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Tnk!.Subprocess))
|
||||
.ForMember(d => d.Tnk, o => o.MapFrom(s => s.ApplicationsInWork!.Work!.Tnk))
|
||||
.ForMember(d => d.ShortDescription, o => o.MapFrom(s => s.ApplicationsInWork!.ShortDescription))
|
||||
.ForMember(d => d.FullDescription, o => o.MapFrom(s => s.ApplicationsInWork!.FullDescription))
|
||||
.ForMember(d => d.Solution, o => o.MapFrom(s => s.ApplicationsInWork!.Solution))
|
||||
.ForMember(d => d.TemplateDuration, o => o.MapFrom(s => s.ApplicationsInWork!.TemplateDuration))
|
||||
.ForMember(d => d.Initiator, o => o.MapFrom<TemplateInitiatorResolver>())
|
||||
.ForMember(d => d.ClosingCode, o => o.MapFrom<TemplateClosingCodeResolver>())
|
||||
.ForMember(d => d.Category, o => o.MapFrom<TemplateCategoryResolver>());
|
||||
|
||||
CreateMap<TemplateResponse, TemplateStringResponse>()
|
||||
.ForMember(d => d.Assignment, o => o.MapFrom(s => s.Host!.WorkGroup))
|
||||
.ForMember(d => d.Title, o => o.MapFrom(s => s.Work!.ShortDescription))
|
||||
.ForMember(d => d.Title, o => o.MapFrom(s => s.ShortDescription))
|
||||
.ForMember(d => d.Branch, o => o.MapFrom(s => s.Host!.ResponseArea))
|
||||
.ForMember(d => d.SlaInterval, o => o.MapFrom(s => s.Work!.TemplateDuration))
|
||||
.ForMember(d => d.SlaInterval, o => o.MapFrom(s => s.TemplateDuration))
|
||||
.ForMember(d => d.ConfigurationItem, o => o.MapFrom(s => s.Host!.Ek))
|
||||
.ForMember(d => d.ContactName, o => o.MapFrom(s => s.Initiator))
|
||||
.ForMember(d => d.Description, o => o.MapFrom(s => s.Work!.FullDescription))
|
||||
.ForMember(d => d.Description, o => o.MapFrom(s => s.FullDescription))
|
||||
.ForMember(d => d.ResolutionCode, o => o.MapFrom(s => s.ClosingCode))
|
||||
.ForMember(d => d.Resolution, o => o.MapFrom(s => s.Work!.Solution))
|
||||
.ForMember(d => d.Resolution, o => o.MapFrom(s => s.Solution))
|
||||
.ForMember(d => d.RzdMTNKprocess, o => o.MapFrom(s => s.Process!.Name))
|
||||
.ForMember(d => d.RzdMTNKprocessId, o => o.MapFrom(s => s.Process!.EsppId))
|
||||
.ForMember(d => d.RzdMTNKsubprocess, o => o.MapFrom(s => s.Subprocess!.Name))
|
||||
|
||||
1451
PARR.DAL/Migrations/20230920020555_TblAppInWorksUpd.Designer.cs
generated
Normal file
1451
PARR.DAL/Migrations/20230920020555_TblAppInWorksUpd.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
116
PARR.DAL/Migrations/20230920020555_TblAppInWorksUpd.cs
Normal file
116
PARR.DAL/Migrations/20230920020555_TblAppInWorksUpd.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace PARR.DAL.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class TblAppInWorksUpd : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FullDescription",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortDescription",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Solution",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TemplateDuration",
|
||||
table: "Works");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "FullDescription",
|
||||
table: "ApplicationsInWorks",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ShortDescription",
|
||||
table: "ApplicationsInWorks",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Solution",
|
||||
table: "ApplicationsInWorks",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TemplateDuration",
|
||||
table: "ApplicationsInWorks",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Settings",
|
||||
columns: new[] { "Name", "Description", "Value" },
|
||||
values: new object[] { "TemplatePrefixName", "Префикс имени шаблона в ЕСПП", "ПАРР-ДВС-ПТК__" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Settings",
|
||||
keyColumn: "Name",
|
||||
keyValue: "TemplatePrefixName");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FullDescription",
|
||||
table: "ApplicationsInWorks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ShortDescription",
|
||||
table: "ApplicationsInWorks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Solution",
|
||||
table: "ApplicationsInWorks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TemplateDuration",
|
||||
table: "ApplicationsInWorks");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "FullDescription",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ShortDescription",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Solution",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TemplateDuration",
|
||||
table: "Works",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,6 +489,22 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<DateTimeOffset?>("DateModified")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("FullDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ShortDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Solution")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TemplateDuration")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("WorkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
@@ -595,6 +611,12 @@ namespace PARR.DAL.Migrations
|
||||
Name = "Category",
|
||||
Description = "Категория создаваемого объекта в ЕСПП",
|
||||
Value = "регламентная работа"
|
||||
},
|
||||
new
|
||||
{
|
||||
Name = "TemplatePrefixName",
|
||||
Description = "Префикс имени шаблона в ЕСПП",
|
||||
Value = "ПАРР-ДВС-ПТК__"
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1101,26 +1123,10 @@ namespace PARR.DAL.Migrations
|
||||
b.Property<int>("EsppId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("FullDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ShortDescription")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Solution")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TemplateDuration")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("TnkId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
|
||||
@@ -20,6 +20,14 @@ namespace PARR.DAL.Models
|
||||
|
||||
public Guid ApplicationId { get; set; }
|
||||
|
||||
public required string TemplateDuration { get; set; }
|
||||
|
||||
public required string ShortDescription { get; set; }
|
||||
|
||||
public required string FullDescription { get; set; }
|
||||
|
||||
public required string Solution { get; set; }
|
||||
|
||||
[ForeignKey(nameof(WorkId))]
|
||||
public Work? Work { get; set; }
|
||||
|
||||
|
||||
@@ -20,14 +20,6 @@ namespace PARR.DAL.Models
|
||||
|
||||
public Guid TnkId { get; set; }
|
||||
|
||||
public required string TemplateDuration { get; set; }
|
||||
|
||||
public required string ShortDescription { get; set; }
|
||||
|
||||
public required string FullDescription { get; set; }
|
||||
|
||||
public required string Solution { get; set; }
|
||||
|
||||
[ForeignKey(nameof(TnkId))]
|
||||
public Tnk? Tnk { get; set; }
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.BLL.Settings;
|
||||
using PARR.DAL.Contracts;
|
||||
using PARR.DAL.Models;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
@@ -98,7 +97,7 @@ namespace PARR.EsppTemplateSync.Services
|
||||
//else
|
||||
// logger.LogInformation($"----- Создана запись Template {esppTemplate.Name}({esppTemplate.ShortDescription}) -----");
|
||||
//---
|
||||
logger.LogWarning($"----- Найден шаблон ЕСПП незарегистрированный в ПАРР {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.Work?.ShortDescription}) -----");
|
||||
logger.LogWarning($"----- Найден шаблон ЕСПП незарегистрированный в ПАРР {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.ShortDescription}) -----");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -131,15 +130,15 @@ namespace PARR.EsppTemplateSync.Services
|
||||
|
||||
if (isChanged)
|
||||
{
|
||||
logger.LogInformation($"----- Запись в ЕСПП отличается от Template {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.Work?.ShortDescription}) -----");
|
||||
logger.LogInformation($"----- Запись в ЕСПП отличается от Template {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.ShortDescription}) -----");
|
||||
|
||||
//template.Status = "Updating";
|
||||
template.StatusCode = (int)StatusTemplateEnum.Updating;
|
||||
|
||||
if (!await templateService.CommitAsync())
|
||||
logger.LogError($"Не удалось обновить запись Template {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.Work?.ShortDescription})");
|
||||
logger.LogError($"Не удалось обновить запись Template {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.ShortDescription})");
|
||||
else
|
||||
logger.LogInformation($"----- Требуется обновление шаблона в ЕСПП роботом {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.Work?.ShortDescription}) -----");
|
||||
logger.LogInformation($"----- Требуется обновление шаблона в ЕСПП роботом {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.ShortDescription}) -----");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -150,7 +149,7 @@ namespace PARR.EsppTemplateSync.Services
|
||||
template.StatusCode = (int)StatusTemplateEnum.Ok;
|
||||
|
||||
if (!await templateService.CommitAsync())
|
||||
logger.LogInformation($"Шаблон в ЕСПП соответствует шаблону в ПАРР {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.Work?.ShortDescription}). Установлен статус {StatusTemplateEnum.Ok}");
|
||||
logger.LogInformation($"Шаблон в ЕСПП соответствует шаблону в ПАРР {esppTemplate.Name}({esppTemplate.ApplicationsInWork?.ShortDescription}). Установлен статус {StatusTemplateEnum.Ok}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user