CsvSerializer

This commit is contained in:
Olga Nemt 2024-10-10 15:29:27 +05:00
parent 0ef3b5a30d
commit 00d489a849
5 changed files with 205 additions and 80 deletions

View File

@ -17,6 +17,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" /> <PackageReference Include="NSubstitute" Version="5.1.0" />

View File

@ -4,11 +4,17 @@ using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Repositories; using AsbCloudApp.Repositories;
using AsbCloudApp.Requests; using AsbCloudApp.Requests;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudInfrastructure.Services; using AsbCloudInfrastructure.Services;
using AsbCloudInfrastructure.Services.SAUB;
using CsvHelper;
using Mapster; using Mapster;
using NSubstitute; using NSubstitute;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Formats.Asn1;
using System.Globalization;
using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -18,6 +24,7 @@ namespace AsbCloudInfrastructure.Tests.Services;
public class DataSaubStatDtillingQualityServiceTest public class DataSaubStatDtillingQualityServiceTest
{ {
private const string UsingTemplateFile = "AsbCloudInfrastructure/Tests/Services/DataSaubStat";
private readonly int Gap = 5; private readonly int Gap = 5;
private readonly IDataSaubStatRepository<DataSaubStatDrillingQualityDto> dataSaubStatRepositoryMock = Substitute.For<IDataSaubStatRepository<DataSaubStatDrillingQualityDto>>(); private readonly IDataSaubStatRepository<DataSaubStatDrillingQualityDto> dataSaubStatRepositoryMock = Substitute.For<IDataSaubStatRepository<DataSaubStatDrillingQualityDto>>();
private readonly ITelemetryDataCache<TelemetryDataSaubDto> telemetryDataCacheMock = Substitute.For<ITelemetryDataCache<TelemetryDataSaubDto>>(); private readonly ITelemetryDataCache<TelemetryDataSaubDto> telemetryDataCacheMock = Substitute.For<ITelemetryDataCache<TelemetryDataSaubDto>>();
@ -142,96 +149,132 @@ public class DataSaubStatDtillingQualityServiceTest
[Fact] [Fact]
public async Task Create_1DataSaubStatItems_ShouldReturn__Success() public async Task Create_1DataSaubStatItems_ShouldReturn__Success()
{ {
var telemetrySaubDto = telemetryDataSaubDtos.FirstOrDefault(); var telemetryDataSaubDtos2 = new List<TelemetryDataSaubDto>();
if (telemetrySaubDto != null) string fileName = @"C:\Users\admin\source\repos\AsbCloudServer\AsbCloudInfrastructure.Tests\Services\DataSaubStat\test.csv";
using (var reader = new StreamReader(fileName))
using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
{ {
//idFeedRegulator depthWell try
//1 800 {
//1 900 csv.Context.RegisterClassMap<TelemetryDataSaubMap>();
//1 1000 var records = csv.GetRecords<TelemetryDataSaubDto>().ToList();
//1 900
//1 1200
//1 1300
//1 1100
//1 1500
//2 1600
//Îćčäŕĺěűĺ đĺçóëüňŕňű äë˙ idFeedRegulator:
// ęîëč÷ĺńňâî âîçâđŕůŕĺěűő çŕďčńĺé = 3
// îáůŕ˙ ăëóáčíŕ = (1000 - 800) + (1300 - 900) + (1600 - 1100) = 1100
var telemetrySaubDto1 = CreateTelemetryDataSaubItem(
telemetrySaubDto,
wellDepth: 900,
bitDepth: 900,
idFeedRegulator: 1,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto1);
var telemetrySaubDto2 = CreateTelemetryDataSaubItem(
telemetrySaubDto,
wellDepth: 1000,
bitDepth: 1000,
idFeedRegulator: 1,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto2);
var telemetrySaubDto3 = CreateTelemetryDataSaubItem(
telemetrySaubDto,
wellDepth: 900,
bitDepth: 900,
idFeedRegulator: 1,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto3);
var telemetrySaubDto4 = CreateTelemetryDataSaubItem( dataSaubServiceMock
telemetrySaubDto, .Get(Arg.Any<int>(), Arg.Any<bool>(), Arg.Any<DateTimeOffset>(), Arg.Any<DateTimeOffset>(), Arg.Any<int>(), Arg.Any<CancellationToken>())
wellDepth: 1200, .Returns(records);
bitDepth: 1200,
idFeedRegulator: 1,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto4);
var telemetrySaubDto5 = CreateTelemetryDataSaubItem( //act
telemetrySaubDto, var result = await dataSaubStatService.CreateStatDrillingQualityForTelemetry(1, DateTimeOffset.UnixEpoch, CancellationToken.None);
wellDepth: 1300,
bitDepth: 1300,
idFeedRegulator: 1,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto5);
var telemetrySaubDto6 = CreateTelemetryDataSaubItem( //assert
telemetrySaubDto, Assert.Equal(3, result.Count());
wellDepth: 1100, }
bitDepth: 1100, catch (Exception ex)
idFeedRegulator: 1, {
dateTime: DateTime.UtcNow.AddMinutes(20)); ;
telemetryDataSaubDtos.Add(telemetrySaubDto6); }
var telemetrySaubDto7 = CreateTelemetryDataSaubItem(
telemetrySaubDto,
wellDepth: 1500,
bitDepth: 1500,
idFeedRegulator: 1,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto7);
var telemetrySaubDto8 = CreateTelemetryDataSaubItem(
telemetrySaubDto,
wellDepth: 1600,
bitDepth: 1600,
idFeedRegulator: 2,
dateTime: DateTime.UtcNow.AddMinutes(20));
telemetryDataSaubDtos.Add(telemetrySaubDto8);
} }
dataSaubServiceMock //var telemetrySaubDto = telemetryDataSaubDtos.FirstOrDefault();
.Get(Arg.Any<int>(), Arg.Any<bool>(), Arg.Any<DateTimeOffset>(), Arg.Any<DateTimeOffset>(), Arg.Any<int>(), Arg.Any<CancellationToken>()) //if (telemetrySaubDto != null)
.Returns(telemetryDataSaubDtos); //{
// //idFeedRegulator depthWell
// //1 800
// //1 900
// //1 1000
// //1 900
// //1 1200
// //1 1300
// //1 1100
// //1 1500
// //2 1600
// //Îæèäàåìûå ðåçóëüòàòû äëÿ idFeedRegulator:
// // êîëè÷åñòâî âîçâðàùàåìûõ çàïèñåé = 3
// // îáùàÿ ãëóáèíà = (1000 - 800) + (1300 - 900) + (1600 - 1100) = 1100
// var telemetrySaubDto1 = CreateTelemetryDataSaubItem(
// telemetrySaubDto,
// wellDepth: 900,
// bitDepth: 900,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto1);
//act // var telemetrySaubDto2 = CreateTelemetryDataSaubItem(
var result = await dataSaubStatService.CreateStatDrillingQualityForTelemetry(1, DateTimeOffset.UnixEpoch, CancellationToken.None); // telemetrySaubDto,
// wellDepth: 1000,
// bitDepth: 1000,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto2);
//assert // var telemetrySaubDto3 = CreateTelemetryDataSaubItem(
Assert.Equal(3, result.Count()); // telemetrySaubDto,
// wellDepth: 900,
// bitDepth: 900,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto3);
// var telemetrySaubDto4 = CreateTelemetryDataSaubItem(
// telemetrySaubDto,
// wellDepth: 1200,
// bitDepth: 1200,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto4);
// var telemetrySaubDto5 = CreateTelemetryDataSaubItem(
// telemetrySaubDto,
// wellDepth: 1300,
// bitDepth: 1300,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto5);
// var telemetrySaubDto6 = CreateTelemetryDataSaubItem(
// telemetrySaubDto,
// wellDepth: 1100,
// bitDepth: 1100,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto6);
// var telemetrySaubDto7 = CreateTelemetryDataSaubItem(
// telemetrySaubDto,
// wellDepth: 1500,
// bitDepth: 1500,
// idFeedRegulator: 1,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto7);
// var telemetrySaubDto8 = CreateTelemetryDataSaubItem(
// telemetrySaubDto,
// wellDepth: 1600,
// bitDepth: 1600,
// idFeedRegulator: 2,
// dateTime: DateTime.UtcNow.AddMinutes(20));
// telemetryDataSaubDtos.Add(telemetrySaubDto8);
//}
}
private TelemetryDataSaubDto Convert(TelemetryDataSaub src, double timezoneOffset)
{
var mapper = MapsterForUnitTests.GetMapper();
var res = new TelemetryDataSaubDto();
var dto = mapper.Map(src, res);
//var telemetryUser = telemetryUserService.GetOrDefault(src.IdTelemetry, src.IdUser ?? int.MinValue);
dto.User = "dfsdf";
//telemetryUser?.MakeDisplayName();
dto.DateTime = src.DateTime.ToRemoteDateTime(timezoneOffset);
dto.BitDepth = src.BitDepth <= src.WellDepth
? src.BitDepth
: src.WellDepth;
return dto;
} }
@ -295,3 +338,10 @@ public class DataSaubStatDtillingQualityServiceTest
// Arg.Any<CancellationToken>()); // Arg.Any<CancellationToken>());
//} //}
} }
internal class TestDto
{
public int Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
}

View File

@ -0,0 +1,60 @@
using AsbCloudApp.Data.SAUB;
using CsvHelper.Configuration;
using AsbCloudInfrastructure.Services;
using CsvHelper.Configuration.Attributes;
using Mapster;
using Microsoft.EntityFrameworkCore;
using System;
using System.Text.Json.Serialization;
namespace AsbCloudDb.Model
{
public class TelemetryDataSaubMap : ClassMap<TelemetryDataSaubDto>
{
public TelemetryDataSaubMap()
{
Map(m => m.AxialLoad).Name("axial_load");
Map(m => m.AxialLoadLimitMax).Name("axial_load_limit_max");
Map(m => m.AxialLoadSp).Name("axial_load_sp");
Map(m => m.BitDepth).Name("bit_depth");
Map(m => m.BlockPosition).Name("block_position");
Map(m => m.BlockPositionMax).Name("block_position_max");
Map(m => m.BlockPositionMin).Name("block_position_min");
Map(m => m.BlockSpeed).Name("block_speed");
Map(m => m.BlockSpeedSp).Name("block_speed_sp");
Map(m => m.BlockSpeedSpDevelop).Name("block_speed_sp_develop");
Map(m => m.BlockSpeedSpRotor).Name("block_speed_sp_rotor");
Map(m => m.BlockSpeedSpSlide).Name("block_speed_sp_slide");
Map(m => m.DateTime).Name("date");
Map(m => m.Flow).Name("flow");
Map(m => m.FlowDeltaLimitMax).Name("flow_delta_limit_max");
Map(m => m.FlowIdle).Name("flow_idle");
Map(m => m.HookWeight).Name("hook_weight");
Map(m => m.HookWeightIdle).Name("hook_weight_idle");
Map(m => m.HookWeightLimitMax).Name("hook_weight_limit_max");
Map(m => m.HookWeightLimitMin).Name("hook_weight_limit_min");
Map(m => m.IdFeedRegulator).Name("id_feed_regulator");
Map(m => m.IdTelemetry).Name("id_telemetry");
Map(m => m.Mode).Name("mode");
Map(m => m.Mse).Name("mse");
Map(m => m.MseState).Name("mse_state");
Map(m => m.Pressure).Name("pressure");
Map(m => m.PressureDeltaLimitMax).Name("pressure_delta_limit_max");
Map(m => m.PressureIdle).Name("pressure_idle");
Map(m => m.PressureSp).Name("pressure_sp");
Map(m => m.PressureSpDevelop).Name("pressure_sp_develop");
Map(m => m.PressureSpRotor).Name("pressure_sp_rotor");
Map(m => m.PressureSpSlide).Name("pressure_sp_slide");
Map(m => m.Pump1Flow).Name("pump1_flow");
Map(m => m.Pump0Flow).Name("pump0_flow");
Map(m => m.Pump2Flow).Name("pump2_flow");
Map(m => m.RotorSpeed).Name("rotor_speed");
Map(m => m.RotorTorque).Name("rotor_torque");
Map(m => m.RotorTorqueIdle).Name("rotor_torque_idle");
Map(m => m.RotorTorqueLimitMax).Name("rotor_torque_limit_max");
Map(m => m.RotorTorqueSp).Name("rotor_torque_sp");
Map(m => m.WellDepth).Name("well_depth");
}
}
}

View File

@ -0,0 +1,12 @@
"id_telemetry","date","mode","id_user","well_depth","bit_depth","block_position","block_position_min","block_position_max","block_speed","block_speed_sp","block_speed_sp_rotor","block_speed_sp_slide","block_speed_sp_develop","pressure","pressure_idle","pressure_sp","pressure_sp_rotor","pressure_sp_slide","pressure_sp_develop","pressure_delta_limit_max","axial_load","axial_load_sp","axial_load_limit_max","hook_weight","hook_weight_idle","hook_weight_limit_min","hook_weight_limit_max","rotor_torque","rotor_torque_idle","rotor_torque_sp","rotor_torque_limit_max","rotor_speed","flow","flow_idle","flow_delta_limit_max","id_feed_regulator","mse_state","mse","pump0_flow","pump1_flow","pump2_flow"
419,2023-02-24 06:52:03.000 +0500,1,1,46.0,46.0,18.561,0.0,0.0,0,100.0,100.0,50.0,100.0,3.2787943,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.296837,25.0,0.0,0.0,0.9,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.62367916,,,
419,2023-02-24 06:52:27.000 +0500,1,1,46.0,46.0,18.561,0.0,0.0,0.0,100.0,100.0,50.0,100.0,3.2657084,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.288881,25.0,0.0,0.0,0.7005794,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.58552027,,,
419,2023-02-24 06:52:01.000 +0500,1,1,46.0,46.0,18.561,0.0,0.0,0,100.0,100.0,50.0,100.0,3.281889,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.290037,25.0,0.0,0.0,1.1,0.0,24.0,28.0,20.0,0.0,0.0,3.0,1,0,0.6230831,,,
419,2023-02-24 06:52:02.000 +0500,1,1,46.0,46.0,18.561,0.0,0.0,0,100.0,100.0,50.0,100.0,3.2758698,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.298437,25.0,0.0,0.0,0.8,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.61103106,,,
419,2023-02-24 06:52:04.000 +0500,0,1,46.0,46.0,18.561,0.0,0.0,0,100.0,100.0,50.0,100.0,3.2403529,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.283327,25.0,0.0,0.0,0.99897236,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.5451977,,,
419,2023-02-24 06:52:28.000 +0500,1,1,46.0,46.0,18.561,0.0,0.0,0.0,100.0,100.0,50.0,100.0,3.2521386,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.271387,25.0,0.0,0.0,0.9986298,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.5644083,,,
419,2023-02-24 06:52:29.000 +0500,0,1,46.0,46.0,18.559,0.0,0.0,0.0,100.0,100.0,50.0,100.0,3.2965276,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.279978,25.0,0.0,0.0,0.7880506,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.6650865,,,
419,2023-02-24 06:52:49.000 +0500,1,1,46.0,46.0,18.347,0.0,0.0,0.02323297,100.0,100.0,50.0,100.0,3.3215039,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.196453,25.0,0.0,0.0,0.8,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.7197559,,,
419,2023-02-24 06:52:50.000 +0500,1,1,46.0,46.0,18.347,0.0,0.0,0.008542753,100.0,100.0,50.0,100.0,3.2545505,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.18471,25.0,0.0,0.0,0.8,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.5640507,,,
419,2023-02-24 06:52:53.000 +0500,1,1,46.0,46.0,18.207,0.0,0.0,11.310025,100.0,100.0,50.0,100.0,3.271237,3.0,35.0,35.0,21.0,18.0,45.0,0.0,4.0,4.5,25.770308,25.0,0.0,0.0,0.99922925,0.0,24.0,28.0,20.1,0.0,0.0,3.0,1,0,0.60237646,,,
419,2023-02-24 15:29:12.000 +0500,1,1,251.28,251.28,11.062,0.5,0.0,52.383633,53.0,53.0,50.0,50.0,46.114864,32.0,68.0,68.0,50.0,47.0,45.0,0.5221672,8.0,11.0,28.4907,29.0,0.0,0.0,5.401707,0.0,24.0,28.0,19.8,0.0,0.0,3.0,1,0,26.786428,,,
1 id_telemetry date mode id_user well_depth bit_depth block_position block_position_min block_position_max block_speed block_speed_sp block_speed_sp_rotor block_speed_sp_slide block_speed_sp_develop pressure pressure_idle pressure_sp pressure_sp_rotor pressure_sp_slide pressure_sp_develop pressure_delta_limit_max axial_load axial_load_sp axial_load_limit_max hook_weight hook_weight_idle hook_weight_limit_min hook_weight_limit_max rotor_torque rotor_torque_idle rotor_torque_sp rotor_torque_limit_max rotor_speed flow flow_idle flow_delta_limit_max id_feed_regulator mse_state mse pump0_flow pump1_flow pump2_flow
2 419 2023-02-24 06:52:03.000 +0500 1 1 46.0 46.0 18.561 0.0 0.0 0 100.0 100.0 50.0 100.0 3.2787943 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.296837 25.0 0.0 0.0 0.9 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.62367916
3 419 2023-02-24 06:52:27.000 +0500 1 1 46.0 46.0 18.561 0.0 0.0 0.0 100.0 100.0 50.0 100.0 3.2657084 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.288881 25.0 0.0 0.0 0.7005794 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.58552027
4 419 2023-02-24 06:52:01.000 +0500 1 1 46.0 46.0 18.561 0.0 0.0 0 100.0 100.0 50.0 100.0 3.281889 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.290037 25.0 0.0 0.0 1.1 0.0 24.0 28.0 20.0 0.0 0.0 3.0 1 0 0.6230831
5 419 2023-02-24 06:52:02.000 +0500 1 1 46.0 46.0 18.561 0.0 0.0 0 100.0 100.0 50.0 100.0 3.2758698 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.298437 25.0 0.0 0.0 0.8 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.61103106
6 419 2023-02-24 06:52:04.000 +0500 0 1 46.0 46.0 18.561 0.0 0.0 0 100.0 100.0 50.0 100.0 3.2403529 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.283327 25.0 0.0 0.0 0.99897236 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.5451977
7 419 2023-02-24 06:52:28.000 +0500 1 1 46.0 46.0 18.561 0.0 0.0 0.0 100.0 100.0 50.0 100.0 3.2521386 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.271387 25.0 0.0 0.0 0.9986298 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.5644083
8 419 2023-02-24 06:52:29.000 +0500 0 1 46.0 46.0 18.559 0.0 0.0 0.0 100.0 100.0 50.0 100.0 3.2965276 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.279978 25.0 0.0 0.0 0.7880506 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.6650865
9 419 2023-02-24 06:52:49.000 +0500 1 1 46.0 46.0 18.347 0.0 0.0 0.02323297 100.0 100.0 50.0 100.0 3.3215039 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.196453 25.0 0.0 0.0 0.8 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.7197559
10 419 2023-02-24 06:52:50.000 +0500 1 1 46.0 46.0 18.347 0.0 0.0 0.008542753 100.0 100.0 50.0 100.0 3.2545505 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.18471 25.0 0.0 0.0 0.8 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.5640507
11 419 2023-02-24 06:52:53.000 +0500 1 1 46.0 46.0 18.207 0.0 0.0 11.310025 100.0 100.0 50.0 100.0 3.271237 3.0 35.0 35.0 21.0 18.0 45.0 0.0 4.0 4.5 25.770308 25.0 0.0 0.0 0.99922925 0.0 24.0 28.0 20.1 0.0 0.0 3.0 1 0 0.60237646
12 419 2023-02-24 15:29:12.000 +0500 1 1 251.28 251.28 11.062 0.5 0.0 52.383633 53.0 53.0 50.0 50.0 46.114864 32.0 68.0 68.0 50.0 47.0 45.0 0.5221672 8.0 11.0 28.4907 29.0 0.0 0.0 5.401707 0.0 24.0 28.0 19.8 0.0 0.0 3.0 1 0 26.786428

View File

@ -49,6 +49,8 @@ public class CsvSerializer<T>
HandleRow(props.Select(p => CsvSerializer<T>.Escape(Fromat(p.GetValue(item))))); HandleRow(props.Select(p => CsvSerializer<T>.Escape(Fromat(p.GetValue(item)))));
} }
private string Fromat(object? obj) private string Fromat(object? obj)
{ {
if (obj is double objDouble) if (obj is double objDouble)