2024-03-20 12:43:15 +05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudApp.Data.WellOperation;
|
|
|
|
|
|
2024-05-23 14:07:40 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Операция по скважине
|
|
|
|
|
/// </summary>
|
2024-03-20 12:43:15 +05:00
|
|
|
|
public class WellOperationDto : ItemInfoDto,
|
|
|
|
|
IId,
|
2024-03-22 09:29:01 +05:00
|
|
|
|
IWellRelated,
|
|
|
|
|
IValidatableObject
|
2024-03-20 12:43:15 +05:00
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
[Required]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
[Required]
|
|
|
|
|
public int IdWell { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Id секции скважины
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int IdWellSectionType { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 0 = план или 1 = факт или прогноз = 2
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required]
|
|
|
|
|
public int IdType { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// id категории операции
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int IdCategory { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Глубина на начало операции, м
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double DepthStart { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Глубина после завершения операции, м
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required]
|
|
|
|
|
[Range(0, 50_000)]
|
|
|
|
|
public double DepthEnd { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Дата начала операции
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required]
|
|
|
|
|
public DateTimeOffset DateStart { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Продолжительность, часы
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double DurationHours { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Наименование секции
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string? WellSectionTypeCaption { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Наименование категории
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string? OperationCategoryName { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// id плановой операции для сопоставления
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int? IdPlan { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Ключ родителя у категории
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int? IdParentCategory { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// дополнительная информация по операции
|
|
|
|
|
/// </summary>
|
|
|
|
|
[StringLength(8192)]
|
|
|
|
|
public string? CategoryInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Кол-во дней от даты начала первой плановой (а если её нет, то фактической) операции
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required]
|
|
|
|
|
public double Day { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Кол-во часов НПВ от даты начала первой плановой (а если её нет, то фактической) операции
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Required]
|
|
|
|
|
public double NptHours { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Полезный комментарий
|
|
|
|
|
/// </summary>
|
|
|
|
|
[StringLength(4096, ErrorMessage = "Комментарий не может быть длиннее 4096 символов")]
|
|
|
|
|
public string? Comment { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <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) });
|
|
|
|
|
}
|
|
|
|
|
}
|