Add WellType into StatWellDto

This commit is contained in:
Фролов 2021-08-25 15:17:24 +05:00
parent 590197d3a6
commit 54d4a16d14
3 changed files with 117 additions and 226 deletions

View File

@ -6,6 +6,7 @@ namespace AsbCloudApp.Data
{ {
public int Id { get; set; } public int Id { get; set; }
public string Caption { get; set; } public string Caption { get; set; }
public string WellType { get; set; }
public IEnumerable<StatSectionDto> Sections { get; set; } public IEnumerable<StatSectionDto> Sections { get; set; }
public PlanFactBase<StatOperationsDto> Total { get; set; } public PlanFactBase<StatOperationsDto> Total { get; set; }
public IEnumerable<CompanyDto> Companies { get; set; } public IEnumerable<CompanyDto> Companies { get; set; }

View File

@ -290,13 +290,12 @@ namespace AsbCloudDb.Model
modelBuilder.Entity<WellSectionType>(entity => { modelBuilder.Entity<WellSectionType>(entity => {
entity.HasData(new List<WellSectionType>{ entity.HasData(new List<WellSectionType>{
new WellSectionType{ Id = 1, Caption = "Обощенное по скважине"}, new WellSectionType{ Id = 1, Caption = "Пилотный ствол"},
new WellSectionType{ Id = 2, Caption = "Пилотный ствол"}, new WellSectionType{ Id = 2, Caption = "Направление"},
new WellSectionType{ Id = 3, Caption = "Направление"}, new WellSectionType{ Id = 3, Caption = "Кондуктор"},
new WellSectionType{ Id = 4, Caption = "Кондуктор"}, new WellSectionType{ Id = 4, Caption = "Эксплуатационная колонна"},
new WellSectionType{ Id = 5, Caption = "Эксплуатационная колонна"}, new WellSectionType{ Id = 5, Caption = "Транспортный ствол"},
new WellSectionType{ Id = 6, Caption = "Транспортный ствол"}, new WellSectionType{ Id = 6, Caption = "Хвостовик"},
new WellSectionType{ Id = 7, Caption = "Хвостовик"},
}); });
}); });
} }
@ -386,206 +385,100 @@ namespace AsbCloudDb.Model
modelBuilder.Entity<WellOperation>(entity => modelBuilder.Entity<WellOperation>(entity =>
{ {
entity.HasData(new List<WellOperation> { entity.HasData(new List<WellOperation> {
new WellOperation{ Id = 1, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 3762, IdWell = 4, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
IdCategory = 1001, IdType = 0, new WellOperation{ Id = 1902, IdWell = 1, IdWellSectionType = 2, IdCategory = 1026, IdType = 1, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-04 13:00"), DurationHours = 3.5},
WellDepth = 200, StartDate = DateTime.Now.AddHours(1), new WellOperation{ Id = 9065, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
DurationHours = 1.2}, new WellOperation{ Id = 9880, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 07:30"), DurationHours = 3.5},
new WellOperation{ Id = 2, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 5965, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 18:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 0, new WellOperation{ Id = 1769, IdWell = 1, IdWellSectionType = 2, IdCategory = 1027, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 23:00"), DurationHours = 3.5},
WellDepth = 210, StartDate = DateTime.Now.AddHours(2), new WellOperation{ Id = 3842, IdWell = 1, IdWellSectionType = 1, IdCategory = 1043, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 05:00"), DurationHours = 3.5},
DurationHours = 1.2}, new WellOperation{ Id = 7410, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 11:30"), DurationHours = 3.5},
new WellOperation{ Id = 3, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 495, IdWell = 2, IdWellSectionType = 2, IdCategory = 1027, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 1, new WellOperation{ Id = 5088, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 14:30"), DurationHours = 3.5},
WellDepth = 200, StartDate = DateTime.Now.AddHours(1.5), new WellOperation{ Id = 5780, IdWell = 1, IdWellSectionType = 1, IdCategory = 1033, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 21:30"), DurationHours = 3.5},
DurationHours = 1}, new WellOperation{ Id = 6397, IdWell = 2, IdWellSectionType = 2, IdCategory = 1025, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
new WellOperation{ Id = 4, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 7021, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 22:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 1, new WellOperation{ Id = 6609, IdWell = 1, IdWellSectionType = 2, IdCategory = 1001, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 05:30"), DurationHours = 3.5},
WellDepth = 220, StartDate = DateTime.Now.AddHours(2), new WellOperation{ Id = 7882, IdWell = 4, IdWellSectionType = 2, IdCategory = 1025, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
DurationHours = 1.5}, new WellOperation{ Id = 8371, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1110, StartDate = DateTime.Parse("2021-08-24 21:00"), DurationHours = 3.5},
new WellOperation{ Id = 5, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 2385, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
IdCategory = 1001, IdType = 0, new WellOperation{ Id = 301, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
WellDepth = 300, StartDate = DateTime.Now.AddHours(1), new WellOperation{ Id = 6422, IdWell = 2, IdWellSectionType = 2, IdCategory = 1026, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
DurationHours = 1.2}, new WellOperation{ Id = 1704, IdWell = 1, IdWellSectionType = 2, IdCategory = 1026, IdType = 0, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-03 12:30"), DurationHours = 3.5},
new WellOperation{ Id = 6, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 9873, IdWell = 2, IdWellSectionType = 2, IdCategory = 1047, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
IdCategory = 1001, IdType = 0, new WellOperation{ Id = 8289, IdWell = 2, IdWellSectionType = 2, IdCategory = 1001, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
WellDepth = 310, StartDate = DateTime.Now.AddHours(2), new WellOperation{ Id = 6626, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 19:30"), DurationHours = 3.5},
DurationHours = 1.2}, new WellOperation{ Id = 3031, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
new WellOperation{ Id = 7, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 3334, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
IdCategory = 1001, IdType = 1, new WellOperation{ Id = 2891, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-27 01:30"), DurationHours = 3.5},
WellDepth = 300, StartDate = DateTime.Now.AddHours(1.5), new WellOperation{ Id = 6018, IdWell = 2, IdWellSectionType = 2, IdCategory = 1026, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
DurationHours = 1}, new WellOperation{ Id = 9137, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-08-27 05:00"), DurationHours = 3.5},
new WellOperation{ Id = 8, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 1873, IdWell = 1, IdWellSectionType = 2, IdCategory = 1047, IdType = 0, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-03 09:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 1, new WellOperation{ Id = 1825, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
WellDepth = 320, StartDate = DateTime.Now.AddHours(2), new WellOperation{ Id = 3984, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 3.5},
DurationHours = 1.5}, new WellOperation{ Id = 2110, IdWell = 4, IdWellSectionType = 2, IdCategory = 1001, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
new WellOperation{ Id = 9, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 4114, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 22:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 0, new WellOperation{ Id = 4960, IdWell = 5, IdWellSectionType = 2, IdCategory = 1026, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
WellDepth = 400, StartDate = DateTime.Now.AddHours(1), new WellOperation{ Id = 5832, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-25 00:30"), DurationHours = 3.5},
DurationHours = 1.2}, new WellOperation{ Id = 6306, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
new WellOperation{ Id = 10, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 2710, IdWell = 1, IdWellSectionType = 1, IdCategory = 1048, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 01:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 0, new WellOperation{ Id = 1409, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-27 01:30"), DurationHours = 3.5},
WellDepth = 420, StartDate = DateTime.Now.AddHours(2), new WellOperation{ Id = 5839, IdWell = 4, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
DurationHours = 1.2}, new WellOperation{ Id = 3671, IdWell = 5, IdWellSectionType = 2, IdCategory = 1025, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
new WellOperation{ Id = 11, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 5462, IdWell = 1, IdWellSectionType = 2, IdCategory = 1047, IdType = 1, WellDepth = 1500, StartDate = DateTime.Parse("2021-09-04 09:30"), DurationHours = 3.5},
IdCategory = 1001, IdType = 1, new WellOperation{ Id = 6822, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
WellDepth = 410, StartDate = DateTime.Now.AddHours(1.5), new WellOperation{ Id = 7958, IdWell = 1, IdWellSectionType = 1, IdCategory = 1045, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-25 11:00"), DurationHours = 3.5},
DurationHours = 1}, new WellOperation{ Id = 461, IdWell = 5, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
new WellOperation{ Id = 12, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 407, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 12:00"), DurationHours = 3.5},
IdCategory = 1001, IdType = 1, new WellOperation{ Id = 165, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
WellDepth = 420, StartDate = DateTime.Now.AddHours(2), new WellOperation{ Id = 9599, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-27 05:00"), DurationHours = 3.5},
DurationHours = 1.5}, new WellOperation{ Id = 3560, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 08:30"), DurationHours = 3.5},
new WellOperation{ Id = 239, IdWell = 1, IdWellSectionType = 2, IdCategory = 1001, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-04 06:00"), DurationHours = 3.5},
new WellOperation{ Id = 101, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 18:30"), DurationHours = 3.5},
new WellOperation{ Id = 13, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 1210, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 0, new WellOperation{ Id = 4979, IdWell = 4, IdWellSectionType = 2, IdCategory = 1026, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
WellDepth = 200, StartDate = DateTime.Now.AddHours(2.5), new WellOperation{ Id = 4335, IdWell = 1, IdWellSectionType = 2, IdCategory = 1027, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 22:30"), DurationHours = 3.5},
DurationHours = 15.5}, new WellOperation{ Id = 6473, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 04:30"), DurationHours = 3.5},
new WellOperation{ Id = 14, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 3020, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
IdCategory = 1046, IdType = 0, new WellOperation{ Id = 9013, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 01:00"), DurationHours = 3.5},
WellDepth = 210, StartDate = DateTime.Now.AddHours(3), new WellOperation{ Id = 9199, IdWell = 1, IdWellSectionType = 1, IdCategory = 1025, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 11:30"), DurationHours = 3.5},
DurationHours = 17.2}, new WellOperation{ Id = 5344, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 19:00"), DurationHours = 3.5},
new WellOperation{ Id = 15, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 3080, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-26 15:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 1, new WellOperation{ Id = 3889, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 21:00"), DurationHours = 3.5},
WellDepth = 220, StartDate = DateTime.Now.AddHours(2.7), new WellOperation{ Id = 8701, IdWell = 2, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 03:30"), DurationHours = 3.5},
DurationHours = 15.2}, new WellOperation{ Id = 8598, IdWell = 4, IdWellSectionType = 2, IdCategory = 1027, IdType = 0, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
new WellOperation{ Id = 16, IdWell = 1, IdWellSectionType = 2, new WellOperation{ Id = 1789, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 1, WellDepth = 1110, StartDate = DateTime.Parse("2021-08-25 04:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 1, new WellOperation{ Id = 3895, IdWell = 2, IdWellSectionType = 2, IdCategory = 1047, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
WellDepth = 220, StartDate = DateTime.Now.AddHours(3.1), new WellOperation{ Id = 5441, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-04 02:30"), DurationHours = 3.5},
DurationHours = 17.8}, new WellOperation{ Id = 8977, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 04:00"), DurationHours = 3.5},
new WellOperation{ Id = 17, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 2803, IdWell = 1, IdWellSectionType = 1, IdCategory = 1047, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 11:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 0, new WellOperation{ Id = 1863, IdWell = 5, IdWellSectionType = 2, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
WellDepth = 300, StartDate = DateTime.Now.AddHours(2.5), new WellOperation{ Id = 8644, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 3.5},
DurationHours = 16.2}, new WellOperation{ Id = 9330, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 18:30"), DurationHours = 3.5},
new WellOperation{ Id = 18, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 1323, IdWell = 2, IdWellSectionType = 2, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 0, new WellOperation{ Id = 489, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1110, StartDate = DateTime.Parse("2021-08-25 00:30"), DurationHours = 3.5},
WellDepth = 320, StartDate = DateTime.Now.AddHours(3.5), new WellOperation{ Id = 5618, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 08:00"), DurationHours = 3.5},
DurationHours = 17.2}, new WellOperation{ Id = 2036, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 07:00"), DurationHours = 3.5},
new WellOperation{ Id = 19, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 1498, IdWell = 4, IdWellSectionType = 2, IdCategory = 1047, IdType = 0, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
IdCategory = 1046, IdType = 1, new WellOperation{ Id = 918, IdWell = 5, IdWellSectionType = 2, IdCategory = 1047, IdType = 1, WellDepth = 1100, StartDate = DateTime.Parse("2021-08-24 17:30"), DurationHours = 15},
WellDepth = 315, StartDate = DateTime.Now.AddHours(2.7), new WellOperation{ Id = 6350, IdWell = 1, IdWellSectionType = 2, IdCategory = 1046, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 02:00"), DurationHours = 3.5},
DurationHours = 15.2}, new WellOperation{ Id = 4483, IdWell = 1, IdWellSectionType = 1, IdCategory = 1045, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 07:30"), DurationHours = 3.5},
new WellOperation{ Id = 20, IdWell = 1, IdWellSectionType = 3, new WellOperation{ Id = 9937, IdWell = 1, IdWellSectionType = 1, IdCategory = 1027, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-25 18:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 1, new WellOperation{ Id = 8519, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 21:30"), DurationHours = 3.5},
WellDepth = 320, StartDate = DateTime.Now.AddHours(3), new WellOperation{ Id = 7148, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-27 12:00"), DurationHours = 17},
DurationHours = 18.2}, new WellOperation{ Id = 4671, IdWell = 5, IdWellSectionType = 2, IdCategory = 1046, IdType = 1, WellDepth = 800, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
new WellOperation{ Id = 21, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 2999, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 10:30"), DurationHours = 3.5},
IdCategory = 1046, IdType = 0, new WellOperation{ Id = 4007, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 04:30"), DurationHours = 3.5},
WellDepth = 410, StartDate = DateTime.Now.AddHours(2.5), new WellOperation{ Id = 1623, IdWell = 2, IdWellSectionType = 2, IdCategory = 1025, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 00:00"), DurationHours = 3.5},
DurationHours = 16.2}, new WellOperation{ Id = 6224, IdWell = 5, IdWellSectionType = 2, IdCategory = 1001, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
new WellOperation{ Id = 22, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 1950, IdWell = 1, IdWellSectionType = 1, IdCategory = 1046, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-27 08:30"), DurationHours = 3.5},
IdCategory = 1046, IdType = 0, new WellOperation{ Id = 5613, IdWell = 1, IdWellSectionType = 2, IdCategory = 1025, IdType = 1, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-03 16:00"), DurationHours = 3.5},
WellDepth = 420, StartDate = DateTime.Now.AddHours(3.5), new WellOperation{ Id = 5719, IdWell = 1, IdWellSectionType = 1, IdCategory = 1033, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-25 14:30"), DurationHours = 3.5},
DurationHours = 17.2}, new WellOperation{ Id = 1325, IdWell = 1, IdWellSectionType = 1, IdCategory = 1048, IdType = 1, WellDepth = 1300, StartDate = DateTime.Parse("2021-08-26 08:00"), DurationHours = 3.5},
new WellOperation{ Id = 23, IdWell = 1, IdWellSectionType = 4, new WellOperation{ Id = 9243, IdWell = 1, IdWellSectionType = 1, IdCategory = 1026, IdType = 0, WellDepth = 1250, StartDate = DateTime.Parse("2021-08-26 15:00"), DurationHours = 3.5},
IdCategory = 1046, IdType = 1, new WellOperation{ Id = 6891, IdWell = 1, IdWellSectionType = 1, IdCategory = 1001, IdType = 1, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
WellDepth = 415, StartDate = DateTime.Now.AddHours(2.7), new WellOperation{ Id = 273, IdWell = 1, IdWellSectionType = 2, IdCategory = 1025, IdType = 0, WellDepth = 1400, StartDate = DateTime.Parse("2021-09-02 15:30"), DurationHours = 3.5},
DurationHours = 15.2}, new WellOperation{ Id = 2897, IdWell = 2, IdWellSectionType = 2, IdCategory = 1001, IdType = 0, WellDepth = 1000, StartDate = DateTime.Parse("2021-08-24 14:00"), DurationHours = 3.5},
new WellOperation{ Id = 24, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1046, IdType = 1,
WellDepth = 420, StartDate = DateTime.Now.AddHours(3),
DurationHours = 18.2},
new WellOperation{ Id = 25, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1047, IdType = 0,
WellDepth = 200, StartDate = DateTime.Now.AddHours(5.25),
DurationHours = 2.1},
new WellOperation{ Id = 26, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1047, IdType = 0,
WellDepth = 220, StartDate = DateTime.Now.AddHours(7.5),
DurationHours = 2},
new WellOperation{ Id = 27, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1047, IdType = 1,
WellDepth = 200, StartDate = DateTime.Now.AddHours(5.15),
DurationHours = 2.75},
new WellOperation{ Id = 28, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1047, IdType = 1,
WellDepth = 250, StartDate = DateTime.Now.AddHours(6.5),
DurationHours = 3.5},
new WellOperation{ Id = 29, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1047, IdType = 0,
WellDepth = 300, StartDate = DateTime.Now.AddHours(5.25),
DurationHours = 2.1},
new WellOperation{ Id = 30, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1047, IdType = 0,
WellDepth = 310, StartDate = DateTime.Now.AddHours(7.5),
DurationHours = 2},
new WellOperation{ Id = 31, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1047, IdType = 1,
WellDepth = 300, StartDate = DateTime.Now.AddHours(5.15),
DurationHours = 2.75},
new WellOperation{ Id = 32, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1047, IdType = 1,
WellDepth = 330, StartDate = DateTime.Now.AddHours(6.5),
DurationHours = 3.5},
new WellOperation{ Id = 33, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1047, IdType = 0,
WellDepth = 400, StartDate = DateTime.Now.AddHours(5.25),
DurationHours = 2.1},
new WellOperation{ Id = 34, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1047, IdType = 0,
WellDepth = 410, StartDate = DateTime.Now.AddHours(7.5),
DurationHours = 2},
new WellOperation{ Id = 35, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1047, IdType = 1,
WellDepth = 400, StartDate = DateTime.Now.AddHours(5.15),
DurationHours = 2.75},
new WellOperation{ Id = 36, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1047, IdType = 1,
WellDepth = 420, StartDate = DateTime.Now.AddHours(6.5),
DurationHours = 3.5},
new WellOperation{ Id = 41, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1048, IdType = 0,
WellDepth = 210, StartDate = DateTime.Now.AddHours(5),
DurationHours = 2},
new WellOperation{ Id = 42, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1048, IdType = 0,
WellDepth = 250, StartDate = DateTime.Now.AddHours(7.5),
DurationHours = 2},
new WellOperation{ Id = 43, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1048, IdType = 1,
WellDepth = 210, StartDate = DateTime.Now.AddHours(5),
DurationHours = 2.5},
new WellOperation{ Id = 44, IdWell = 1, IdWellSectionType = 2,
IdCategory = 1048, IdType = 1,
WellDepth = 220, StartDate = DateTime.Now.AddHours(6.5),
DurationHours = 2.5},
new WellOperation{ Id = 45, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1048, IdType = 0,
WellDepth = 310, StartDate = DateTime.Now.AddHours(5),
DurationHours = 2},
new WellOperation{ Id = 46, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1048, IdType = 0,
WellDepth = 350, StartDate = DateTime.Now.AddHours(7.5),
DurationHours = 2},
new WellOperation{ Id = 47, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1048, IdType = 1,
WellDepth = 300, StartDate = DateTime.Now.AddHours(5),
DurationHours = 2.5},
new WellOperation{ Id = 48, IdWell = 1, IdWellSectionType = 3,
IdCategory = 1048, IdType = 1,
WellDepth = 310, StartDate = DateTime.Now.AddHours(6.5),
DurationHours = 2.5},
new WellOperation{ Id = 49, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1048, IdType = 0,
WellDepth = 410, StartDate = DateTime.Now.AddHours(5),
DurationHours = 2},
new WellOperation{ Id = 50, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1048, IdType = 0,
WellDepth = 450, StartDate = DateTime.Now.AddHours(7.5),
DurationHours = 2},
new WellOperation{ Id = 51, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1048, IdType = 1,
WellDepth = 400, StartDate = DateTime.Now.AddHours(5),
DurationHours = 2.5},
new WellOperation{ Id = 52, IdWell = 1, IdWellSectionType = 4,
IdCategory = 1048, IdType = 1,
WellDepth = 410, StartDate = DateTime.Now.AddHours(6.5),
DurationHours = 2.5},
}); });
}); });

View File

@ -21,23 +21,19 @@ namespace AsbCloudInfrastructure.Services
IdWellSectionType = operation.IdWellSectionType; IdWellSectionType = operation.IdWellSectionType;
IdCategory = operation.IdCategory; IdCategory = operation.IdCategory;
WellDepth = operation.WellDepth;
Start = operation.StartDate; Start = operation.StartDate;
DurationHours = operation.DurationHours;
WellDepthReal = operation.WellDepth; WellDepth = operation.WellDepth;
DeltaDepth = 0; DeltaDepth = 0;
DurationToNextOperationHours = operation.DurationHours; DurationHours = operation.DurationHours;
} }
public int IdWellSectionType { get; } public int IdWellSectionType { get; }
public int IdCategory { get; } public int IdCategory { get; }
public int Id { get; } public int Id { get; }
public DateTime Start { get; } public DateTime Start { get; }
public double WellDepth { get; } public double WellDepth { get; set; }
public double DurationHours { get; }
public double WellDepthReal { get; set; }
public double DeltaDepth { get; set; } public double DeltaDepth { get; set; }
public double DurationToNextOperationHours { get; set; } public double DurationHours { get; set; }
} }
class Race class Race
@ -131,6 +127,7 @@ namespace AsbCloudInfrastructure.Services
{ {
Id = idWell, Id = idWell,
Caption = well.Caption, Caption = well.Caption,
WellType = well.WellType.Caption,
Companies = await wellService.GetCompaniesAsync(idWell, token), Companies = await wellService.GetCompaniesAsync(idWell, token),
Sections = CalcSectionsStats(operations), Sections = CalcSectionsStats(operations),
Total = GetStat(operations), Total = GetStat(operations),
@ -193,8 +190,8 @@ namespace AsbCloudInfrastructure.Services
{ {
Start = operations.First().Start, Start = operations.First().Start,
End = operations.Max(o => (o.Start.AddHours(o.DurationHours))), End = operations.Max(o => (o.Start.AddHours(o.DurationHours))),
WellDepthStart = operations.Min(o => o.WellDepthReal), WellDepthStart = operations.Min(o => o.WellDepth),
WellDepthEnd = operations.Max(o => o.WellDepthReal), WellDepthEnd = operations.Max(o => o.WellDepth),
RouteSpeed = CalcAvgRaceSpeed(operations), RouteSpeed = CalcAvgRaceSpeed(operations),
Rop = CalcROP(operations), Rop = CalcROP(operations),
BhaDownSpeed = CalcSpeedByOperation(operations, idOperationBhaDown), BhaDownSpeed = CalcSpeedByOperation(operations, idOperationBhaDown),
@ -211,8 +208,8 @@ namespace AsbCloudInfrastructure.Services
var dHours = 0d; var dHours = 0d;
foreach (var operation in ops) foreach (var operation in ops)
{ {
if (maxDepth > operation.WellDepthReal) if (maxDepth > operation.WellDepth)
maxDepth = operation.WellDepthReal; maxDepth = operation.WellDepth;
dHours += operation.DurationHours; dHours += operation.DurationHours;
} }
return maxDepth / (dHours + double.Epsilon); return maxDepth / (dHours + double.Epsilon);
@ -258,10 +255,10 @@ namespace AsbCloudInfrastructure.Services
item = operations.ElementAt(i); item = operations.ElementAt(i);
current = new OperationParams(item) current = new OperationParams(item)
{ {
WellDepthReal = Helper.Max(wellDepth, item.WellDepth) // TODO: учесть операциии с уменьшение глубины ствола. WellDepth = Helper.Max(wellDepth, item.WellDepth) // TODO: учесть операциии с уменьшение глубины ствола.
}; };
pre.DeltaDepth = current.WellDepthReal - wellDepth; pre.DeltaDepth = current.WellDepth - wellDepth;
pre.DurationToNextOperationHours = (current.Start - pre.Start).TotalHours; pre.DurationHours = (current.Start - pre.Start).TotalHours;
ops.Add(pre); ops.Add(pre);
pre = current; pre = current;
} }
@ -280,7 +277,7 @@ namespace AsbCloudInfrastructure.Services
var race = new Race var race = new Race
{ {
StartDate = iterator.Current.Start.AddHours(iterator.Current.DurationHours), StartDate = iterator.Current.Start.AddHours(iterator.Current.DurationHours),
StartWellDepth = iterator.Current.WellDepthReal StartWellDepth = iterator.Current.WellDepth
}; };
while (iterator.MoveNext()) while (iterator.MoveNext())
{ {
@ -291,7 +288,7 @@ namespace AsbCloudInfrastructure.Services
if (iterator.Current.IdCategory == idOperationBhaDisassembly) if (iterator.Current.IdCategory == idOperationBhaDisassembly)
{ {
race.EndDate = iterator.Current.Start.AddHours(iterator.Current.DurationHours); race.EndDate = iterator.Current.Start.AddHours(iterator.Current.DurationHours);
race.EndWellDepth = iterator.Current.WellDepthReal; race.EndWellDepth = iterator.Current.WellDepth;
races.Add(race); races.Add(race);
} }
} }