forked from ddrilling/AsbCloudServer
Merge branch 'dev'
This commit is contained in:
commit
3175fb3a1c
@ -223,6 +223,7 @@ namespace AsbCloudDb
|
|||||||
private static string FormatValue(object? v)
|
private static string FormatValue(object? v)
|
||||||
=> v switch
|
=> v switch
|
||||||
{
|
{
|
||||||
|
null => "NULL",
|
||||||
string vStr => $"'{EscapeCurlyBraces(vStr)}'",
|
string vStr => $"'{EscapeCurlyBraces(vStr)}'",
|
||||||
DateTime vDate => $"'{FormatDateValue(vDate)}'",
|
DateTime vDate => $"'{FormatDateValue(vDate)}'",
|
||||||
DateTimeOffset vDate => $"'{FormatDateValue(vDate.UtcDateTime)}'",
|
DateTimeOffset vDate => $"'{FormatDateValue(vDate.UtcDateTime)}'",
|
||||||
|
@ -43,7 +43,10 @@ public class WellInfoService
|
|||||||
|
|
||||||
var wellsIds = activeWells.Select(w => w.Id);
|
var wellsIds = activeWells.Select(w => w.Id);
|
||||||
|
|
||||||
var processMapPlanWellDrillingRequests = wellsIds.Select(id => new ProcessMapPlanBaseRequestWithWell(id));
|
var processMapPlanWellDrillingRequests = wellsIds.Select(id => new ProcessMapPlanBaseRequestWithWell(id)
|
||||||
|
{
|
||||||
|
Moment = DateTimeOffset.UtcNow.AddDays(1)
|
||||||
|
});
|
||||||
var processMapPlanWellDrillings = new List<ProcessMapPlanDrillingDto>();
|
var processMapPlanWellDrillings = new List<ProcessMapPlanDrillingDto>();
|
||||||
foreach (var processMapPlanWellDrillingRequest in processMapPlanWellDrillingRequests)
|
foreach (var processMapPlanWellDrillingRequest in processMapPlanWellDrillingRequests)
|
||||||
{
|
{
|
||||||
@ -97,14 +100,21 @@ public class WellInfoService
|
|||||||
int? idSection = wellLastFactSection?.Id;
|
int? idSection = wellLastFactSection?.Id;
|
||||||
ProcessMapPlanDrillingDto? processMapPlanWellDrilling = null;
|
ProcessMapPlanDrillingDto? processMapPlanWellDrilling = null;
|
||||||
|
|
||||||
if (idSection.HasValue)
|
if(idSection.HasValue && currentDepth.HasValue)
|
||||||
{
|
{
|
||||||
processMapPlanWellDrilling = wellProcessMaps.FirstOrDefault(p => p.IdWellSectionType == idSection);
|
processMapPlanWellDrilling = wellProcessMaps
|
||||||
|
.Where(p => p.IdWellSectionType == idSection)
|
||||||
|
.Where(p => p.DepthStart <= currentDepth.Value && p.DepthEnd >= currentDepth.Value)
|
||||||
|
.FirstOrDefault();
|
||||||
}
|
}
|
||||||
else if(currentDepth.HasValue)
|
else if(currentDepth.HasValue)
|
||||||
{
|
{
|
||||||
processMapPlanWellDrilling = wellProcessMaps.FirstOrDefault(p => p.DepthStart <= currentDepth.Value && p.DepthEnd >= currentDepth.Value);
|
processMapPlanWellDrilling = wellProcessMaps.FirstOrDefault(p => p.DepthStart <= currentDepth.Value && p.DepthEnd >= currentDepth.Value);
|
||||||
}
|
}
|
||||||
|
else if (idSection.HasValue)
|
||||||
|
{
|
||||||
|
processMapPlanWellDrilling = wellProcessMaps.FirstOrDefault(p => p.IdWellSectionType == idSection);
|
||||||
|
}
|
||||||
|
|
||||||
double? planTotalDepth = null;
|
double? planTotalDepth = null;
|
||||||
planTotalDepth = wellDepthByProcessMap.FirstOrDefault(p => p.Id == well.Id)?.DepthEnd;
|
planTotalDepth = wellDepthByProcessMap.FirstOrDefault(p => p.Id == well.Id)?.DepthEnd;
|
||||||
|
Loading…
Reference in New Issue
Block a user