Added null check for ClusterSections table

This commit is contained in:
KharchenkoVV 2021-08-31 13:50:13 +05:00
parent e779253ff6
commit af76dad0b2

View File

@ -157,28 +157,28 @@ export default function ClusterSections({ clusterData }) {
id: well.id,
caption: well.caption,
sectionType: section.caption,
sectionWellDepthPlan: section.plan.wellDepthEnd,
sectionWellDepthFact: section.fact.wellDepthEnd,
sectionWellDepthPlan: section.plan?.wellDepthEnd,
sectionWellDepthFact: section.fact?.wellDepthEnd,
sectionBuildDaysPlan: (
(new Date(section.plan.end) - new Date(section.plan.start)) /
(new Date(section.plan?.end) - new Date(section.plan?.start)) /
(1000 * 60 * 60 * 24)
).toFixed(2),
sectionBuildDaysFact: (
(new Date(section.fact.end) - new Date(section.fact.start)) /
(new Date(section.fact?.end) - new Date(section.fact?.start)) /
(1000 * 60 * 60 * 24)
).toFixed(2),
sectionRateOfPenetrationPlan: section.plan.rop.toFixed(2),
sectionRateOfPenetrationFact: section.fact.rop.toFixed(2),
sectionRouteSpeedPlan: section.plan.routeSpeed.toFixed(2),
sectionRouteSpeedFact: section.fact.routeSpeed.toFixed(2),
sectionBhaDownSpeedPlan: section.plan.bhaDownSpeed.toFixed(2),
sectionBhaDownSpeedFact: section.fact.bhaDownSpeed.toFixed(2),
sectionBhaUpSpeedPlan: section.plan.bhaUpSpeed.toFixed(2),
sectionBhaUpSpeedFact: section.fact.bhaUpSpeed.toFixed(2),
sectionCasingDownSpeedPlan: section.plan.casingDownSpeed.toFixed(2),
sectionCasingDownSpeedFact: section.fact.casingDownSpeed.toFixed(2),
nonProductiveTimePlan: section.plan.nonProductiveHours.toFixed(2),
nonProductiveTimeFact: section.fact.nonProductiveHours.toFixed(2),
sectionRateOfPenetrationPlan: section.plan?.rop.toFixed(2),
sectionRateOfPenetrationFact: section.fact?.rop.toFixed(2),
sectionRouteSpeedPlan: section.plan?.routeSpeed.toFixed(2),
sectionRouteSpeedFact: section.fact?.routeSpeed.toFixed(2),
sectionBhaDownSpeedPlan: section.plan?.bhaDownSpeed.toFixed(2),
sectionBhaDownSpeedFact: section.fact?.bhaDownSpeed.toFixed(2),
sectionBhaUpSpeedPlan: section.plan?.bhaUpSpeed.toFixed(2),
sectionBhaUpSpeedFact: section.fact?.bhaUpSpeed.toFixed(2),
sectionCasingDownSpeedPlan: section.plan?.casingDownSpeed.toFixed(2),
sectionCasingDownSpeedFact: section.fact?.casingDownSpeed.toFixed(2),
nonProductiveTimePlan: section.plan?.nonProductiveHours.toFixed(2),
nonProductiveTimeFact: section.fact?.nonProductiveHours.toFixed(2),
companies: well.companies,
};