2023-12-29 11:24:46 +05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2023-02-17 15:30:17 +05:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Data
|
2021-07-27 13:32:00 +05:00
|
|
|
|
{
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Операции на скважине (заведенные пользователем)
|
|
|
|
|
/// </summary>
|
2023-12-29 11:24:46 +05:00
|
|
|
|
public class WellOperationDto : ItemInfoDto, IId, IWellRelated, IValidatableObject
|
2023-06-06 15:53:22 +05:00
|
|
|
|
{
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <inheritdoc/>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2021-07-28 09:46:58 +05:00
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <inheritdoc/>
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Required]
|
2021-08-16 14:19:43 +05:00
|
|
|
|
public int IdWell { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// id секции скважины
|
|
|
|
|
/// </summary>
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Required]
|
2021-08-16 14:19:43 +05:00
|
|
|
|
public int IdWellSectionType { get; set; }
|
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// название секции скважины
|
|
|
|
|
/// </summary>
|
2023-02-21 13:22:24 +05:00
|
|
|
|
public string? WellSectionTypeName { get; set; }
|
2021-08-16 14:19:43 +05:00
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// id категории операции
|
|
|
|
|
/// </summary>
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Required]
|
2023-06-06 15:13:44 +05:00
|
|
|
|
[Range(5000, int.MaxValue)]
|
2021-08-18 14:52:52 +05:00
|
|
|
|
public int IdCategory { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
2023-02-15 17:02:43 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// id плановой операции для сопоставления
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int? IdPlan { get; set; }
|
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// название категории операции
|
|
|
|
|
/// </summary>
|
2023-02-21 13:22:24 +05:00
|
|
|
|
public string? CategoryName { get; set; }
|
2021-08-13 17:25:06 +05:00
|
|
|
|
|
2023-03-27 17:14:36 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// ключ родителя у категории
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int? IdParentCategory { get; set; }
|
|
|
|
|
|
2022-06-02 12:35:51 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// дополнительная информация по операции
|
|
|
|
|
/// </summary>
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[StringLength(8192)]
|
|
|
|
|
public string? CategoryInfo { get; set; }
|
2021-08-18 14:52:52 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-08-27 12:15:04 +05:00
|
|
|
|
/// 0 = план или 1 = факт или прогноз = 2
|
2021-08-18 14:52:52 +05:00
|
|
|
|
/// </summary>
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Required]
|
2021-08-18 16:57:20 +05:00
|
|
|
|
public int IdType { get; set; }
|
2021-07-28 09:46:58 +05:00
|
|
|
|
|
2021-10-08 11:30:06 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Глубина на начало операции, м
|
|
|
|
|
/// </summary>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Range(0, 50_000)]
|
2021-10-08 11:30:06 +05:00
|
|
|
|
public double DepthStart { get; set; }
|
2021-07-28 09:46:58 +05:00
|
|
|
|
|
2021-10-08 11:30:06 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Глубина после завершения операции, м
|
|
|
|
|
/// </summary>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Range(0, 50_000)]
|
2021-10-08 11:30:06 +05:00
|
|
|
|
public double DepthEnd { get; set; }
|
2021-07-28 09:46:58 +05:00
|
|
|
|
|
2022-01-12 17:46:33 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Кол-во дней от даты начала первой плановой (а если её нет, то фактической) операции
|
|
|
|
|
/// </summary>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2022-01-12 17:46:33 +05:00
|
|
|
|
public double Day { get; set; }
|
|
|
|
|
|
2022-03-04 10:15:52 +05:00
|
|
|
|
/// <summary>
|
2022-03-10 17:17:34 +05:00
|
|
|
|
/// Кол-во часов НПВ от даты начала первой плановой (а если её нет, то фактической) операции
|
2022-03-04 10:15:52 +05:00
|
|
|
|
/// </summary>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2022-03-10 17:17:34 +05:00
|
|
|
|
public double NptHours { get; set; }
|
2022-03-04 10:15:52 +05:00
|
|
|
|
|
2021-10-08 11:30:06 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Дата начала операции
|
|
|
|
|
/// </summary>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2023-12-29 11:24:46 +05:00
|
|
|
|
public DateTimeOffset DateStart { get; set; }
|
2021-10-08 11:30:06 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Продолжительность, часы
|
|
|
|
|
/// </summary>
|
2023-12-29 14:21:42 +05:00
|
|
|
|
[Required]
|
2023-02-17 15:30:17 +05:00
|
|
|
|
[Range(0, 50)]
|
2021-08-16 14:19:43 +05:00
|
|
|
|
public double DurationHours { get; set; }
|
2021-07-28 09:46:58 +05:00
|
|
|
|
|
2021-10-08 11:30:06 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Полезный комментарий
|
|
|
|
|
/// </summary>
|
2023-03-10 05:09:41 +05:00
|
|
|
|
[StringLength(4096, ErrorMessage = "Комментарий не может быть длиннее 4096 символов")]
|
2023-02-17 15:30:17 +05:00
|
|
|
|
public string? Comment { get; set; }
|
2023-12-29 11:24:46 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Валидация даты
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="validationContext"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
|
|
|
|
{
|
|
|
|
|
var gtDate = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero);
|
|
|
|
|
if (DateStart <= gtDate)
|
|
|
|
|
yield return new ValidationResult(
|
|
|
|
|
$"{nameof(DateStart)}: DateStart не может быть меньше {gtDate}",
|
|
|
|
|
new[] { nameof(DateStart) });
|
|
|
|
|
}
|
2021-07-27 13:32:00 +05:00
|
|
|
|
}
|
|
|
|
|
}
|