From d1ae9a3687268f7f7584c22cadd35eef579486d3 Mon Sep 17 00:00:00 2001 From: Eirik Sander-Fjeld Date: Thu, 6 Oct 2022 11:46:21 +0200 Subject: [PATCH] Change cell values for Surf (#778) --- backend/api/Helpers/ProspImportSettings.cs | 1 + backend/api/Services/ProspExcelImportService.cs | 7 ++++--- backend/api/appsettings.json | 9 +++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/backend/api/Helpers/ProspImportSettings.cs b/backend/api/Helpers/ProspImportSettings.cs index 8844ffb87..7b1aae2f9 100644 --- a/backend/api/Helpers/ProspImportSettings.cs +++ b/backend/api/Helpers/ProspImportSettings.cs @@ -33,6 +33,7 @@ public class Surf public string versionDate { get; set; } = null!; public string costYear { get; set; } = null!; public string importedCurrency { get; set; } = null!; + public string cessationCost { get; set; } = null!; } public class TopSide diff --git a/backend/api/Services/ProspExcelImportService.cs b/backend/api/Services/ProspExcelImportService.cs index 748815717..962229c7c 100644 --- a/backend/api/Services/ProspExcelImportService.cs +++ b/backend/api/Services/ProspExcelImportService.cs @@ -66,7 +66,7 @@ private static int ReadIntValue(IEnumerable cellData, string coordinate) return value; } - return -1; + return 0; } private static double[] ReadDoubleValues(IEnumerable cellData, List coordinates) @@ -118,7 +118,7 @@ private void ImportSurf(List cellData, Guid sourceCaseId, Guid projectId) var producerCount = ReadIntValue(cellData, _prospConfig.Surf.producerCount); var waterInjectorCount = ReadIntValue(cellData, _prospConfig.Surf.waterInjectorCount); var gasInjectorCount = ReadIntValue(cellData, _prospConfig.Surf.gasInjectorCount); - + var cessationCost = ReadIntValue(cellData, _prospConfig.Surf.cessationCost); //TODO: Add cessation cost from PROSP after feedback from PO // var cessationCost = ReadDoubleValue(parsedData, "K88"); var costProfile = new SurfCostProfile @@ -153,7 +153,8 @@ private void ImportSurf(List cellData, Guid sourceCaseId, Guid projectId) DG4Date = dG4Date, ProducerCount = producerCount, GasInjectorCount = gasInjectorCount, - WaterInjectorCount = waterInjectorCount + WaterInjectorCount = waterInjectorCount, + CessationCost = cessationCost }; var dto = SurfDtoAdapter.Convert(newSurf); _surfService.CreateSurf(dto, sourceCaseId); diff --git a/backend/api/appsettings.json b/backend/api/appsettings.json index dffda8820..e5c87ae0d 100644 --- a/backend/api/appsettings.json +++ b/backend/api/appsettings.json @@ -44,12 +44,13 @@ "artificialLiftInt":"E48", "riserCount":"K36", "templateCount":"K32", - "producerCount":"E38", - "waterInjectorCount":"E39", - "gasInjectorCount":"E40", + "producerCount":"E45", + "waterInjectorCount":"E46", + "gasInjectorCount":"E47", "versionDate":"I4", "costYear":"K4", - "importedCurrency":"E8" + "importedCurrency":"E8", + "cessationCost": "K88" }, "TopSide": {