forked from ddrilling/AsbCloudServer
rep and dto
This commit is contained in:
parent
d27aa4e83a
commit
99687c495f
19
AsbCloudApp/Data/PlanLimitDto.cs
Normal file
19
AsbCloudApp/Data/PlanLimitDto.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
namespace AsbCloudApp.Data
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Плановое значение и максимально допустимое ограничение
|
||||||
|
/// </summary>
|
||||||
|
public class PlanLimitDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// План
|
||||||
|
/// </summary>
|
||||||
|
public double Plan { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Максимальное ограничение
|
||||||
|
/// </summary>
|
||||||
|
public double LimitMax { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -20,6 +20,12 @@ namespace AsbCloudApp.Data.ProcessMap
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int? IdUser { get; set; }
|
public int? IdUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Id режима 1-ротор, 2 - слайд
|
||||||
|
/// </summary>
|
||||||
|
[Range(1, 2, ErrorMessage = "Id режима должен быть либо 1-ротор либо 2-слайд")]
|
||||||
|
public int IdMode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Тип секции
|
/// Тип секции
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -45,27 +51,27 @@ namespace AsbCloudApp.Data.ProcessMap
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Нагрузка
|
/// Нагрузка
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PlanFactDto AxialLoad { get; set; } = null!;
|
public PlanLimitDto AxialLoad { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Перепад давления
|
/// Перепад давления
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PlanFactDto Pressure { get; set; } = null!;
|
public PlanLimitDto Pressure { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Момент на ВСП
|
/// Момент на ВСП
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PlanFactDto TopDriveTorque { get; set; } = null!;
|
public PlanLimitDto TopDriveTorque { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Обороты на ВСП
|
/// Обороты на ВСП
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PlanFactDto TopDriveSpeed { get; set; } = null!;
|
public PlanLimitDto TopDriveSpeed { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Расход
|
/// Расход
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PlanFactDto Flow { get; set; } = null!;
|
public PlanLimitDto Flow { get; set; } = null!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Плановая механическая скорость, м/ч
|
/// Плановая механическая скорость, м/ч
|
||||||
|
@ -109,29 +109,29 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
{
|
{
|
||||||
var dto = entity.Adapt<ProcessMapDto>();
|
var dto = entity.Adapt<ProcessMapDto>();
|
||||||
dto.LastUpdate = entity.LastUpdate.ToRemoteDateTime(entity.Well.Timezone.Hours);
|
dto.LastUpdate = entity.LastUpdate.ToRemoteDateTime(entity.Well.Timezone.Hours);
|
||||||
dto.AxialLoad = new PlanFactDto
|
dto.AxialLoad = new PlanLimitDto
|
||||||
{
|
{
|
||||||
Fact = entity.AxialLoadFact,
|
LimitMax = entity.AxialLoadLimitMax,
|
||||||
Plan = entity.AxialLoadPlan
|
Plan = entity.AxialLoadPlan
|
||||||
};
|
};
|
||||||
dto.Flow = new PlanFactDto
|
dto.Flow = new PlanLimitDto
|
||||||
{
|
{
|
||||||
Fact = entity.FlowFact,
|
LimitMax = entity.FlowLimitMax,
|
||||||
Plan = entity.FlowPlan
|
Plan = entity.FlowPlan
|
||||||
};
|
};
|
||||||
dto.Pressure = new PlanFactDto
|
dto.Pressure = new PlanLimitDto
|
||||||
{
|
{
|
||||||
Fact = entity.PressureFact,
|
LimitMax = entity.PressureLimitMax,
|
||||||
Plan = entity.PressurePlan
|
Plan = entity.PressurePlan
|
||||||
};
|
};
|
||||||
dto.TopDriveSpeed = new PlanFactDto
|
dto.TopDriveSpeed = new PlanLimitDto
|
||||||
{
|
{
|
||||||
Fact = entity.TopDriveSpeedFact,
|
LimitMax = entity.TopDriveSpeedLimitMax,
|
||||||
Plan = entity.TopDriveSpeedPlan
|
Plan = entity.TopDriveSpeedPlan
|
||||||
};
|
};
|
||||||
dto.TopDriveTorque = new PlanFactDto
|
dto.TopDriveTorque = new PlanLimitDto
|
||||||
{
|
{
|
||||||
Fact = entity.TopDriveTorqueFact,
|
LimitMax = entity.TopDriveTorqueLimitMax,
|
||||||
Plan = entity.TopDriveTorquePlan
|
Plan = entity.TopDriveTorquePlan
|
||||||
};
|
};
|
||||||
return dto;
|
return dto;
|
||||||
@ -141,19 +141,19 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
{
|
{
|
||||||
var entity = dto.Adapt<ProcessMap>();
|
var entity = dto.Adapt<ProcessMap>();
|
||||||
entity.AxialLoadPlan = dto.AxialLoad.Plan;
|
entity.AxialLoadPlan = dto.AxialLoad.Plan;
|
||||||
entity.AxialLoadFact = dto.AxialLoad.Fact;
|
entity.AxialLoadLimitMax = dto.AxialLoad.LimitMax;
|
||||||
|
|
||||||
entity.FlowPlan = dto.Flow.Plan;
|
entity.FlowPlan = dto.Flow.Plan;
|
||||||
entity.FlowFact = dto.Flow.Fact;
|
entity.FlowLimitMax = dto.Flow.LimitMax;
|
||||||
|
|
||||||
entity.PressurePlan = dto.Pressure.Plan;
|
entity.PressurePlan = dto.Pressure.Plan;
|
||||||
entity.PressureFact = dto.Pressure.Fact;
|
entity.PressureLimitMax = dto.Pressure.LimitMax;
|
||||||
|
|
||||||
entity.TopDriveSpeedPlan = dto.TopDriveSpeed.Plan;
|
entity.TopDriveSpeedPlan = dto.TopDriveSpeed.Plan;
|
||||||
entity.TopDriveSpeedFact = dto.TopDriveSpeed.Fact;
|
entity.TopDriveSpeedLimitMax = dto.TopDriveSpeed.LimitMax;
|
||||||
|
|
||||||
entity.TopDriveTorquePlan = dto.TopDriveTorque.Plan;
|
entity.TopDriveTorquePlan = dto.TopDriveTorque.Plan;
|
||||||
entity.TopDriveTorqueFact = dto.TopDriveTorque.Fact;
|
entity.TopDriveTorqueLimitMax = dto.TopDriveTorque.LimitMax;
|
||||||
|
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
@ -59,38 +59,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
IdWellSectionType = x.IdWellSectionType
|
IdWellSectionType = x.IdWellSectionType
|
||||||
});
|
});
|
||||||
|
|
||||||
var processMap = await processMapRepository.GetProcessMapAsync(requests, token);
|
var result = await processMapRepository.GetProcessMapAsync(requests, token);
|
||||||
|
|
||||||
var result = processMap.Select(x => new ProcessMapDto
|
|
||||||
{
|
|
||||||
IdWell = x.IdWell,
|
|
||||||
IdWellSectionType = x.IdWellSectionType,
|
|
||||||
RopPlan = x.RopPlan,
|
|
||||||
DepthStart = x.DepthStart,
|
|
||||||
DepthEnd = x.DepthEnd,
|
|
||||||
AxialLoad = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.AxialLoad.Fact ?? x.AxialLoad.Plan,
|
|
||||||
},
|
|
||||||
Flow = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.Flow.Fact ?? x.Flow.Plan
|
|
||||||
},
|
|
||||||
Pressure = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.Pressure.Fact ?? x.Pressure.Plan
|
|
||||||
},
|
|
||||||
TopDriveSpeed = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.TopDriveSpeed.Fact ?? x.TopDriveSpeed.Plan
|
|
||||||
},
|
|
||||||
TopDriveTorque = new PlanFactDto
|
|
||||||
{
|
|
||||||
Plan = x.TopDriveTorque.Fact ?? x.TopDriveTorque.Plan
|
|
||||||
},
|
|
||||||
LastUpdate = DateTime.UtcNow
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user