From 433900a1eed41c4028a94a05a88d4a0999b1f589 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Wed, 4 Aug 2021 14:22:00 +0500 Subject: [PATCH] CS2-43: Fixed 'Last data' tables saving issues --- AsbCloudApp/Data/FluidDataDto.cs | 5 ++++- AsbCloudApp/Data/MudDiagramDataDto.cs | 11 +++++++---- AsbCloudApp/Data/NnbDataDto.cs | 6 +++++- AsbCloudDb/Model/FluidData.cs | 5 ++++- AsbCloudDb/Model/LastData.cs | 3 --- AsbCloudDb/Model/MudDiagramData.cs | 7 +++++-- AsbCloudDb/Model/NnbData.cs | 6 +++++- AsbCloudInfrastructure/Services/LastDataService.cs | 2 -- 8 files changed, 30 insertions(+), 15 deletions(-) diff --git a/AsbCloudApp/Data/FluidDataDto.cs b/AsbCloudApp/Data/FluidDataDto.cs index e296fcf5..6f1d41c2 100644 --- a/AsbCloudApp/Data/FluidDataDto.cs +++ b/AsbCloudApp/Data/FluidDataDto.cs @@ -1,8 +1,11 @@ -namespace AsbCloudApp.Data +using System; + +namespace AsbCloudApp.Data { public class FluidDataDto { public int Key { get; set; } + public DateTime LastUpdate { get; set; } = DateTime.Now; public string Name { get; set; } public double Temperature { get; set; } public double Density { get; set; } diff --git a/AsbCloudApp/Data/MudDiagramDataDto.cs b/AsbCloudApp/Data/MudDiagramDataDto.cs index ef3a81c4..da29d257 100644 --- a/AsbCloudApp/Data/MudDiagramDataDto.cs +++ b/AsbCloudApp/Data/MudDiagramDataDto.cs @@ -1,8 +1,11 @@ -namespace AsbCloudApp.Data +using System; + +namespace AsbCloudApp.Data { public class MudDiagramDataDto { public int Key { get; set; } + public DateTime LastUpdate { get; set; } = DateTime.Now; public double ProbeNumber { get; set; } public double ProbeExtractionDepth { get; set; } public double Sandstone { get; set; } @@ -14,16 +17,16 @@ public double Clay { get; set; } public double Camstone { get; set; } public double Cement { get; set; } - public double Summary { get; set; } + public string Summary { get; set; } public double DrillingMud { get; set; } public double Sludge { get; set; } public double MaxSum { get; set; } public double Methane { get; set; } - public double Ethan { get; set; } + public double Ethane { get; set; } public double Propane { get; set; } public double Butane { get; set; } public double Pentane { get; set; } public double MechanicalSpeed { get; set; } - public double PreliminaryConclusion { get; set; } + public string PreliminaryConclusion { get; set; } } } diff --git a/AsbCloudApp/Data/NnbDataDto.cs b/AsbCloudApp/Data/NnbDataDto.cs index 0d7b02e5..4871a50f 100644 --- a/AsbCloudApp/Data/NnbDataDto.cs +++ b/AsbCloudApp/Data/NnbDataDto.cs @@ -1,10 +1,14 @@ -namespace AsbCloudApp.Data +using System; + +namespace AsbCloudApp.Data { public class NnbDataDto { public int Key { get; set; } + public DateTime LastUpdate { get; set; } = DateTime.Now; public double Depth { get; set; } public double ZenithAngle { get; set; } + public double MagneticAzimuth { get; set; } public double TrueAzimuth { get; set; } public double ConditionalViscosity { get; set; } public double DirectAzimuth { get; set; } diff --git a/AsbCloudDb/Model/FluidData.cs b/AsbCloudDb/Model/FluidData.cs index 65aa41be..effa8681 100644 --- a/AsbCloudDb/Model/FluidData.cs +++ b/AsbCloudDb/Model/FluidData.cs @@ -1,8 +1,11 @@ -namespace AsbCloudDb.Model +using System; + +namespace AsbCloudDb.Model { public class FluidData { public int Key { get; set; } + public DateTime LastUpdate { get; set; } = DateTime.Now; public string Name { get; set; } public double Temperature { get; set; } public double Density { get; set; } diff --git a/AsbCloudDb/Model/LastData.cs b/AsbCloudDb/Model/LastData.cs index e2bf64f6..7cdfa796 100644 --- a/AsbCloudDb/Model/LastData.cs +++ b/AsbCloudDb/Model/LastData.cs @@ -19,9 +19,6 @@ namespace AsbCloudDb.Model [Column("id_category"), Comment("id категории")] public int IdCategory { get; set; } - [Column("last_update_date")] - public DateTime LastUpdateDate { get; set; } - [Column("data", TypeName = "jsonb"), Comment("Данные таблицы последних данных")] public object Data { get; set; } diff --git a/AsbCloudDb/Model/MudDiagramData.cs b/AsbCloudDb/Model/MudDiagramData.cs index 666d4b3b..4eeb4b79 100644 --- a/AsbCloudDb/Model/MudDiagramData.cs +++ b/AsbCloudDb/Model/MudDiagramData.cs @@ -1,8 +1,11 @@ -namespace AsbCloudDb.Model +using System; + +namespace AsbCloudDb.Model { public class MudDiagramData { public int Key { get; set; } + public DateTime LastUpdate { get; set; } = DateTime.Now; public double ProbeNumber { get; set; } public double ProbeExtractionDepth { get; set; } public double Sandstone { get; set; } @@ -19,7 +22,7 @@ public double Sludge { get; set; } public double MaxSum { get; set; } public double Methane { get; set; } - public double Ethan { get; set; } + public double Ethane { get; set; } public double Propane { get; set; } public double Butane { get; set; } public double Pentane { get; set; } diff --git a/AsbCloudDb/Model/NnbData.cs b/AsbCloudDb/Model/NnbData.cs index 7fdf09cb..6cfbef7b 100644 --- a/AsbCloudDb/Model/NnbData.cs +++ b/AsbCloudDb/Model/NnbData.cs @@ -1,10 +1,14 @@ -namespace AsbCloudDb.Model +using System; + +namespace AsbCloudDb.Model { public class NnbData { public int Key { get; set; } + public DateTime LastUpdate { get; set; } = DateTime.Now; public double Depth { get; set; } public double ZenithAngle { get; set; } + public double MagneticAzimuth { get; set; } public double TrueAzimuth { get; set; } public double ConditionalViscosity { get; set; } public double DirectAzimuth { get; set; } diff --git a/AsbCloudInfrastructure/Services/LastDataService.cs b/AsbCloudInfrastructure/Services/LastDataService.cs index 8b1a6799..b9102cb8 100644 --- a/AsbCloudInfrastructure/Services/LastDataService.cs +++ b/AsbCloudInfrastructure/Services/LastDataService.cs @@ -37,7 +37,6 @@ namespace AsbCloudInfrastructure.Services if (entity is not null) { - entity.LastUpdateDate = DateTime.Now; entity.Data = model; db.LastData.Update(entity); } @@ -47,7 +46,6 @@ namespace AsbCloudInfrastructure.Services { IdWell = idWell, IdCategory = idCategory, - LastUpdateDate = DateTime.Now, Data = model }; db.LastData.Add(newLastData);