diff --git a/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs b/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs index 0090c752..eb2eadac 100644 --- a/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs +++ b/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs @@ -85,8 +85,8 @@ namespace AsbCloudInfrastructure.Repository }; dto.Pressure = new PlanFactDto { - Fact = entity.FlowFact, - Plan = entity.FlowPlan + Fact = entity.PressureFact, + Plan = entity.PressurePlan }; dto.TopDriveSpeed = new PlanFactDto { @@ -100,6 +100,27 @@ namespace AsbCloudInfrastructure.Repository }; return dto; } + + protected override ProcessMap Convert(ProcessMapDto dto) + { + var entity = dto.Adapt(); + entity.AxialLoadPlan = dto.AxialLoad.Plan; + entity.AxialLoadFact = dto.AxialLoad.Fact; + + entity.FlowPlan = dto.Flow.Plan; + entity.FlowFact = dto.Flow.Fact; + + entity.PressurePlan = dto.Pressure.Plan; + entity.PressureFact = dto.Pressure.Fact; + + entity.TopDriveSpeedPlan = dto.TopDriveSpeed.Plan; + entity.TopDriveSpeedFact = dto.TopDriveSpeed.Fact; + + entity.TopDriveTorquePlan = dto.TopDriveTorque.Plan; + entity.TopDriveTorqueFact = dto.TopDriveTorque.Fact; + + return entity; + } } #nullable disable } \ No newline at end of file diff --git a/AsbCloudWebApi/Controllers/ProcessMapController.cs b/AsbCloudWebApi/Controllers/ProcessMapController.cs index a547fae4..6d4681ed 100644 --- a/AsbCloudWebApi/Controllers/ProcessMapController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMapController.cs @@ -110,7 +110,7 @@ namespace AsbCloudWebApi.Controllers public override async Task> UpdateAsync([FromBody] ProcessMapDto value, CancellationToken token) { value.IdUser = User.GetUserId() ?? -1; - return await base.InsertAsync(value, token); + return await base.UpdateAsync(value, token); } } #nullable disable