CF2-55: Added data to cluster info tables

This commit is contained in:
KharchenkoVV 2021-08-26 11:05:30 +05:00
parent 36bd376b7a
commit ac987546b3
17 changed files with 275 additions and 260 deletions

View File

@ -1,13 +1,29 @@
import { Layout, Menu } from "antd";
import { Link, Switch, Route, useParams } from "react-router-dom";
import { useState, useEffect } from "react"
import ClusterWells from './ClusterWells'
import ClusterSections from './ClusterSections'
import LoaderPortal from '../components/LoaderPortal'
import {invokeWebApiWrapperAsync} from '../components/factory'
import {WellOperationStatService} from "../services/api";
const { Content } = Layout;
export default function ClusterInfo() {
let { id } = useParams();
let {tab} = useParams()
let { tab } = useParams()
const [data, setData] = useState([]);
const [showLoader, setShowLoader] = useState(false)
useEffect(() => {
invokeWebApiWrapperAsync(
async () => {
const clusterData = await WellOperationStatService.getStatCluster(id)
setData(clusterData)
},
setShowLoader,
`Не удалось загрузить данные по кусту "${id}"`)
} ,[id])
return(<>
<Layout>
@ -25,16 +41,18 @@ export default function ClusterInfo() {
</Layout>
<Layout>
<Content className="site-layout-background">
<Switch>
<Route path="/cluster/:id/all">
<ClusterWells />
</Route>
<Route path="/cluster/:id/sections">
<ClusterSections />
</Route>
</Switch>
</Content>
<LoaderPortal show={showLoader}>
<Content className="site-layout-background">
<Switch>
<Route path="/cluster/:id/all">
<ClusterWells clusterData = {data}/>
</Route>
<Route path="/cluster/:id/sections">
<ClusterSections clusterData = {data}/>
</Route>
</Switch>
</Content>
</LoaderPortal>
</Layout>
</>)
}

View File

@ -1,7 +1,8 @@
import { Table, Tag, Button, Badge, Divider, Modal} from "antd"
import { useParams } from "react-router-dom";
import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons'
import { useState } from "react"
import { makeTextColumn, makeGroupColumn, makeNumericColumn, makeNumericColumnPlanFact, calcAndUpdateStatsBySections } from '../components/Table/index'
import { useState, useEffect } from "react"
import { makeTextColumn, makeNumericColumnPlanFact, calcAndUpdateStatsBySections } from '../components/Table/index'
const filtersMinMax = [
@ -63,17 +64,15 @@ const ModalWindowButton = ({buttonIcon, buttonText, modalTitle, modalContent}) =
const columns = [
makeTextColumn('скв №', 'caption'),
makeGroupColumn( 'По секциям', [
makeTextColumn('Конструкция скважины', 'sectionType', filtersSectionsType),
makeNumericColumnPlanFact('Глубина', 'sectionWellDepth', filtersMinMax),
makeNumericColumnPlanFact('Продолжительность', 'sectionBuildDays', filtersMinMax), //Цикл строительства
makeNumericColumnPlanFact('МСП', 'sectionRateOfPenetration', filtersMinMax),
makeNumericColumnPlanFact('Рейсовая скорость', 'sectionRouteSpeed', filtersMinMax),
makeNumericColumnPlanFact('Спуск КНБК', 'sectionBhaDownSpeed', filtersMinMax),//Скорость спуска КНБК
makeNumericColumnPlanFact('Подъем КНБК', 'sectionBhaUpSpeed', filtersMinMax),//Скорость подъема КНБК
makeNumericColumnPlanFact('Скорость спуска ОК', 'sectionCasingDownSpeed', filtersMinMax),
]),
makeNumericColumn('НПВ, сут', 'notProductiveTime', filtersMinMax, '80px'),
makeTextColumn('Секция', 'sectionType', filtersSectionsType),
makeNumericColumnPlanFact('Глубина', 'sectionWellDepth', filtersMinMax),
makeNumericColumnPlanFact('Продолжительность', 'sectionBuildDays', filtersMinMax), //Цикл строительства
makeNumericColumnPlanFact('МСП', 'sectionRateOfPenetration', filtersMinMax),
makeNumericColumnPlanFact('Рейсовая скорость', 'sectionRouteSpeed', filtersMinMax),
makeNumericColumnPlanFact('Спуск КНБК', 'sectionBhaDownSpeed', filtersMinMax),//Скорость спуска КНБК
makeNumericColumnPlanFact('Подъем КНБК', 'sectionBhaUpSpeed', filtersMinMax),//Скорость подъема КНБК
makeNumericColumnPlanFact('Скорость спуска ОК', 'sectionCasingDownSpeed', filtersMinMax),
makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax),
{
title: "TVD",
render: (_, record) => <ModalWindowButton
@ -92,51 +91,76 @@ const columns = [
title: "Подрядчики",
dataIndex: "companies",
render: (item) =>
item.map((company) => <Tag color="blue">{company.caption}</Tag>),
item?.map((company) => <Tag color="blue">{company.caption}</Tag>),
},
]
const contractors = [
{ type: "Буровой подрядчик", caption: 'ООО "НГ-Бурение"' },
// { type: "ННБ", caption: 'ООО НПП "Буринтех"' },
// { type: "Растворный сревис", caption: 'ООО НПП "Буринтех"' },
// { type: "Цементирование", caption: "Норд-Сервис" },
]
const wellsStat = [
{ key:1, caption :'42669', sectionType :'Направление', sectionWellDepthPlan :80.0, sectionWellDepthFact :79.0, sectionBuildDaysPlan :19.0, sectionBuildDaysFact :10.3, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :158.0, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :4.2, sectionRouteSpeedFact :7.7, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :1.0, sectionBhaDownSpeedFact :0.3, sectionBhaUpSpeedPlan :1.0, sectionBhaUpSpeedFact :0.3, sectionCasingDownSpeedPlan :2.0, sectionCasingDownSpeedFact :1.0, notProductiveTime: 10, companies :contractors },
{ key:2, caption :'42669', sectionType :'Кондуктор', sectionWellDepthPlan :1280.0, sectionWellDepthFact :1284.0, sectionBuildDaysPlan :90.0, sectionBuildDaysFact :138.3, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :85.5, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :14.2, sectionRouteSpeedFact :9.3, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :12.5, sectionBhaDownSpeedFact :5.8, sectionBhaUpSpeedPlan :11.0, sectionBhaUpSpeedFact :10.5, sectionCasingDownSpeedPlan :10.0, sectionCasingDownSpeedFact :14.0, notProductiveTime: 11, companies :contractors },
{ key:3, caption :'42669', sectionType :'Транспорт. Ствол', sectionWellDepthPlan :3615.9, sectionWellDepthFact :3616.0, sectionBuildDaysPlan :406.1, sectionBuildDaysFact :391.0, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :57.7, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :8.9, sectionRouteSpeedFact :9.2, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :50.0, sectionBhaDownSpeedFact :40.5, sectionBhaUpSpeedPlan :52.0, sectionBhaUpSpeedFact :57.2, sectionCasingDownSpeedPlan :14.0, sectionCasingDownSpeedFact :16.3, notProductiveTime: 12, companies :contractors },
{ key:4, caption :'16311', sectionType :'Направление', sectionWellDepthPlan :80.0, sectionWellDepthFact :81.0, sectionBuildDaysPlan :10.8, sectionBuildDaysFact :11.0, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :81.0, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :7.4, sectionRouteSpeedFact :7.4, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :1.0, sectionBhaDownSpeedFact :0.5, sectionBhaUpSpeedPlan :1.0, sectionBhaUpSpeedFact :0.5, sectionCasingDownSpeedPlan :1.0, sectionCasingDownSpeedFact :2.3, notProductiveTime: 13, companies :contractors },
{ key:5, caption :'16311', sectionType :'Кондуктор', sectionWellDepthPlan :1411.0, sectionWellDepthFact :1412.0, sectionBuildDaysPlan :107.8, sectionBuildDaysFact :99.0, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :96.4, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :13.1, sectionRouteSpeedFact :14.3, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :12.5, sectionBhaDownSpeedFact :0.3, sectionBhaUpSpeedPlan :11.0, sectionBhaUpSpeedFact :8.8, sectionCasingDownSpeedPlan :9.0, sectionCasingDownSpeedFact :12.8, notProductiveTime: 14, companies :contractors },
{ key:6, caption :'16311', sectionType :'Транспорт. Ствол', sectionWellDepthPlan :3181.0, sectionWellDepthFact :3181.0, sectionBuildDaysPlan :171.6, sectionBuildDaysFact :171.0, sectionRateOfPenetrationPlan :35.0, sectionRateOfPenetrationFact :80.9, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :18.5, sectionRouteSpeedFact :18.6, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :14.0, sectionBhaDownSpeedFact :4.8, sectionBhaUpSpeedPlan :23.0, sectionBhaUpSpeedFact :14.8, sectionCasingDownSpeedPlan :15.0, sectionCasingDownSpeedFact :16.5, notProductiveTime: 15, companies :contractors },
{ key:7, caption :'16311', sectionType :'Хвостовик', sectionWellDepthPlan :4181.0, sectionWellDepthFact :4187.0, sectionBuildDaysPlan :271.9, sectionBuildDaysFact :220.0, sectionRateOfPenetrationPlan :20.0, sectionRateOfPenetrationFact :32.9, rateOfPenetrationPlan :60.0, rateOfPenetrationFact :63.7, sectionRouteSpeedPlan :15.4, sectionRouteSpeedFact :19.0, routeSpeedPlan :9.7, routeSpeedFact :9.2, sectionBhaDownSpeedPlan :61.5, sectionBhaDownSpeedFact :34.0, sectionBhaUpSpeedPlan :40.0, sectionBhaUpSpeedFact :36.5, sectionCasingDownSpeedPlan :24.5, sectionCasingDownSpeedFact :9.0, notProductiveTime: 16, companies :contractors },
{ key:8, caption :'16315', sectionType :'Направление', sectionWellDepthPlan :80.0, sectionWellDepthFact :80.0, sectionBuildDaysPlan :21.1, sectionBuildDaysFact :23.0, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :53.3, rateOfPenetrationPlan :27.2, rateOfPenetrationFact :30.1, sectionRouteSpeedPlan :3.8, sectionRouteSpeedFact :3.5, routeSpeedPlan :14.4, routeSpeedFact :7.5, sectionBhaDownSpeedPlan :1.0, sectionBhaDownSpeedFact :0.5, sectionBhaUpSpeedPlan :1.0, sectionBhaUpSpeedFact :1.0, sectionCasingDownSpeedPlan :2.0, sectionCasingDownSpeedFact :2.0, notProductiveTime: 17, companies :contractors },
{ key:9, caption :'16315', sectionType :'Кондуктор', sectionWellDepthPlan :1500.0, sectionWellDepthFact :1505.0, sectionBuildDaysPlan :130.3, sectionBuildDaysFact :150.5, sectionRateOfPenetrationPlan :60.0, sectionRateOfPenetrationFact :58.2, rateOfPenetrationPlan :27.2, rateOfPenetrationFact :30.1, sectionRouteSpeedPlan :11.5, sectionRouteSpeedFact :10.0, routeSpeedPlan :14.4, routeSpeedFact :7.5, sectionBhaDownSpeedPlan :8.3, sectionBhaDownSpeedFact :0.5, sectionBhaUpSpeedPlan :11.0, sectionBhaUpSpeedFact :6.5, sectionCasingDownSpeedPlan :10.0, sectionCasingDownSpeedFact :11.0, notProductiveTime: 18, companies :contractors }
]
calcAndUpdateStatsBySections(wellsStat, [
"sectionWellDepthPlan",
"sectionWellDepthFact",
"sectionBuildDaysPlan",
"sectionBuildDaysFact",
"sectionRateOfPenetrationPlan",
"sectionRateOfPenetrationFact",
"sectionRouteSpeedPlan",
"sectionRouteSpeedFact",
"sectionBhaDownSpeedPlan",
"sectionBhaDownSpeedFact",
"sectionBhaUpSpeedPlan",
"sectionBhaUpSpeedFact",
"sectionCasingDownSpeedPlan",
"sectionCasingDownSpeedFact",
"notProductiveTime"
])
export default function ClusterStat() {
export default function ClusterSections({clusterData}) {
let { id } = useParams()
const [wellsStat, setWellsStat] = useState([])
const [selectedWells, setSelectedWells] = useState([])
const [selectedWellsKeys, setSelectedWellsKeys] = useState([])
calcAndUpdateStatsBySections(wellsStat ?? [], [
"sectionWellDepthPlan",
"sectionWellDepthFact",
"sectionBuildDaysPlan",
"sectionBuildDaysFact",
"sectionRateOfPenetrationPlan",
"sectionRateOfPenetrationFact",
"sectionRouteSpeedPlan",
"sectionRouteSpeedFact",
"sectionBhaDownSpeedPlan",
"sectionBhaDownSpeedFact",
"sectionBhaUpSpeedPlan",
"sectionBhaUpSpeedFact",
"sectionCasingDownSpeedPlan",
"sectionCasingDownSpeedFact",
"notProductiveTimePlan",
"notProductiveTimeFact"
])
useEffect(() => {
let resArr = []
clusterData.statsWells?.forEach(el => {
el.sections.forEach(section => {
let row = {
key: el.id,
id: el.id,
caption: el.caption,
sectionType: section.caption,
sectionWellDepthPlan: section.plan.wellDepthEnd,
sectionWellDepthFact: section.fact.wellDepthEnd,
sectionBuildDaysPlan: (Math.abs(new Date(section.plan.start) -
new Date(section.plan.end)) / (1000 * 60 * 60 * 24)).toFixed(2),
sectionBuildDaysFact: (Math.abs(new Date(section.fact.start) -
new Date(section.fact.end)) / (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),
notProductiveTimePlan: section.plan.nonProductiveHours.toFixed(2),
notProductiveTimeFact: section.fact.nonProductiveHours.toFixed(2),
companies: el.companies
}
resArr.push(row)
})
})
setWellsStat(resArr)
}, [id, clusterData])
const rowSelection = {
selectedRowKeys: selectedWellsKeys,
onChange: (keys, items) => {
@ -144,7 +168,7 @@ export default function ClusterStat() {
setSelectedWellsKeys(keys)
},
}
return (
<>
<Table

View File

@ -1,11 +1,9 @@
import { useParams } from "react-router-dom";
import { Link } from "react-router-dom";
import LoaderPortal from '../components/LoaderPortal'
import { useState, useEffect } from "react";
import { ClusterService } from '../services/api'
import { notify } from "../components/factory"
import { Table, Tag, Button } from 'antd';
import { makeTextColumn, makeGroupColumn, makeNumericColumn, makeNumericColumnPlanFact, calcAndUpdateStatsBySections } from '../components/Table/index'
import { makeTextColumn, makeGroupColumn, makeNumericColumn,
makeNumericColumnPlanFact, calcAndUpdateStatsBySections } from '../components/Table/index'
const filtersMinMax = [
@ -30,63 +28,49 @@ const filtersWellsType = [
}
]
const contractors = [
{ type: "Буровой подрядчик", caption: 'ООО "НГ-Бурение"' },
// { type: "ННБ", caption: 'ООО НПП "Буринтех"' },
// { type: "Растворный сревис", caption: 'ООО НПП "Буринтех"' },
// { type: "Цементирование", caption: "Норд-Сервис" },
]
const wellsStatDefault = [
{ key:1, caption :'42669', wellType :'Наклонно-направленная', factStart: 5, factEnd: 12, periodPlan :80.0, periodFact :79.0, rateOfPenetrationPlan :19.0, rateOfPenetrationFact :10.3, routeSpeedPlan :60.0, routeSpeedFact :158.0, notProductiveTime: 10, companies :contractors },
{ key:2, caption :'42669', wellType :'Горизонтальная', factStart: 7, factEnd: 11, periodPlan :1280.0, periodFact :1284.0, rateOfPenetrationPlan :90.0, rateOfPenetrationFact :138.3, routeSpeedPlan :60.0, routeSpeedFact :85.5, notProductiveTime: 11, companies :contractors },
{ key:3, caption :'42669', wellType :'Наклонно-направленная', factStart: 8, factEnd: 13, periodPlan :3615.9, periodFact :3616.0, rateOfPenetrationPlan :406.1, rateOfPenetrationFact :391.0, routeSpeedPlan :60.0, routeSpeedFact :57.7, notProductiveTime: 12, companies :contractors },
{ key:4, caption :'16311', wellType :'Наклонно-направленная', factStart: 9, factEnd: 17, periodPlan :80.0, periodFact :81.0, rateOfPenetrationPlan :10.8, rateOfPenetrationFact :11.0, routeSpeedPlan :60.0, routeSpeedFact :81.0, notProductiveTime: 13, companies :contractors },
{ key:5, caption :'16314', wellType :'Горизонтальная', factStart: 15, factEnd: 15, periodPlan :1411.0, periodFact :1412.0, rateOfPenetrationPlan :107.8, rateOfPenetrationFact :99.0, routeSpeedPlan :60.0, routeSpeedFact :96.4, notProductiveTime: 14, companies :contractors },
{ key:6, caption :'16311', wellType :'Наклонно-направленная', factStart: 14, factEnd: 20, periodPlan :3181.0, periodFact :3181.0, rateOfPenetrationPlan :171.6, rateOfPenetrationFact :171.0, routeSpeedPlan :35.0, routeSpeedFact :80.9, notProductiveTime: 15, companies :contractors },
{ key:7, caption :'16311', wellType :'Горизонтальная', factStart: 12, factEnd: 21, periodPlan :4181.0, periodFact :4187.0, rateOfPenetrationPlan :271.9, rateOfPenetrationFact :220.0, routeSpeedPlan :20.0, routeSpeedFact :32.9, notProductiveTime: 16, companies :contractors },
{ key:8, caption :'16315', wellType :'Наклонно-направленная', factStart: 13, factEnd: 22, periodPlan :80.0, periodFact :80.0, rateOfPenetrationPlan :21.1, rateOfPenetrationFact :23.0, routeSpeedPlan :60.0, routeSpeedFact :53.3, notProductiveTime: 17, companies :contractors },
{ key:9, caption :'16315', wellType :'Горизонтальная', factStart: 11, factEnd: 23, periodPlan :1500.0, periodFact :1505.0, rateOfPenetrationPlan :130.3, rateOfPenetrationFact :150.5, routeSpeedPlan :60.0, routeSpeedFact :58.2, notProductiveTime: 18, companies :contractors }
]
calcAndUpdateStatsBySections(wellsStatDefault, [
"factStart",
"factEnd",
"periodPlan",
"periodFact",
"rateOfPenetrationPlan",
"rateOfPenetrationFact",
"routeSpeedPlan",
"routeSpeedFact",
"notProductiveTime"
])
export default function Cluster() {
export default function ClusterWells({clusterData}) {
let { id } = useParams()
const [wellsStat, setWellsStat] = useState(wellsStatDefault)
const [showLoader, setShowLoader] = useState(false)
const [wellsStat, setWellsStat] = useState([])
calcAndUpdateStatsBySections(wellsStat ?? [], [
"factStart",
"factEnd",
"periodPlan",
"periodFact",
"rateOfPenetrationPlan",
"rateOfPenetrationFact",
"routeSpeedPlan",
"routeSpeedFact",
"notProductiveTime"
])
useEffect(() => {
const updateWellsStat = async () => {
setShowLoader(true)
try {
const msInDay = 1000 * 60 * 60 * 24
const data = await ClusterService.getStat(id)
const wellsStat = data.wellsStat.map(w => ({
...w,
periodPlan: (new Date(w.planEnd) - new Date(w.planStart)) / msInDay,
periodFact: (new Date(w.factEnd) - new Date(w.factStart)) / msInDay,
}))
setWellsStat(wellsStat)
let tableData = clusterData.statsWells?.map(el => {
return {
key: el.id,
id: el.id,
caption: el.caption,
wellType: el.wellType,
factStart: new Date(el.total.fact.start).toLocaleString(),
factEnd: new Date(el.total.fact.end).toLocaleString(),
periodPlan: (Math.abs(new Date(el.total.plan.start) -
new Date(el.total.plan.end)) / (1000 * 60 * 60 * 24)).toFixed(2),
periodFact: (Math.abs(new Date(el.total.fact.start) -
new Date(el.total.fact.end)) / (1000 * 60 * 60 * 24)).toFixed(2),
rateOfPenetrationPlan: el.total.plan.rop.toFixed(2),
rateOfPenetrationFact: el.total.fact.rop.toFixed(2),
routeSpeedPlan: el.total.plan.routeSpeed.toFixed(2),
routeSpeedFact: el.total.fact.routeSpeed.toFixed(2),
notProductiveTimePlan: el.total.plan.nonProductiveHours.toFixed(2),
notProductiveTimeFact: el.total.fact.nonProductiveHours.toFixed(2),
companies: el.companies
}
catch (ex) {
notify(`Не удалось загрузить статистику по скважинам куста "${id}"`, 'error')
console.log(ex)
}
setShowLoader(false)
}
updateWellsStat()
}, [id])
})
setWellsStat(tableData)
}, [id, clusterData])
const columns = [
makeTextColumn('скв №', 'caption', null, null,
@ -99,7 +83,7 @@ export default function Cluster() {
makeNumericColumnPlanFact('Продолжительность', 'period', filtersMinMax),
makeNumericColumnPlanFact('МСП', 'rateOfPenetration', filtersMinMax),
makeNumericColumnPlanFact('Рейсовая скорость', 'routeSpeed', filtersMinMax),
makeNumericColumn('НПВ, сут', 'notProductiveTime', filtersMinMax),
makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax),
{
title: 'График глубина-день',
render: (_, item) => (<Button>Открыть</Button>)
@ -117,15 +101,14 @@ export default function Cluster() {
];
return (
<LoaderPortal show={showLoader}>
<Table
columns={columns}
dataSource={wellsStat}
size={'small'}
bordered
pagination={false}
rowKey={(record) => record.id}
className={'mt-20px'}
/>
</LoaderPortal>)
<Table
columns={columns}
dataSource={wellsStat}
size={'small'}
bordered
pagination={false}
rowKey={(record) => record.id}
className={'mt-20px'}
/>
)
}

View File

@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'
import LoaderPortal from '../../components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '../../components/factory'
import { Table, makeColumn, makeColumnsPlanFact } from '../../components/Table'
import { WellSectionService } from '../../services/api'
import { WellOperationStatService } from '../../services/api'
const makeNumberRender = (format) => ((value) => (+value).toFixed(format))
@ -23,7 +23,7 @@ export const WellSectionsStat = ({idWell}) => {
useEffect(() => invokeWebApiWrapperAsync(
async () => {
const sectionsResponse = await WellSectionService.getSectionsByWellId(idWell)
const sectionsResponse = await WellOperationStatService.getSectionsByWellId(idWell)
if(sectionsResponse){
const sections = sectionsResponse.sort((a,b)=>a.wellDepthPlan - b.wellDepthPlan)

View File

@ -6,7 +6,6 @@ export { OpenAPI } from './core/OpenAPI';
export type { AuthDto } from './models/AuthDto';
export type { ClusterDto } from './models/ClusterDto';
export type { ClusterStatDto } from './models/ClusterStatDto';
export type { CompanyDto } from './models/CompanyDto';
export type { DataSaubBaseDto } from './models/DataSaubBaseDto';
export type { DatesRangeDto } from './models/DatesRangeDto';
@ -19,6 +18,11 @@ export type { MessageDto } from './models/MessageDto';
export type { MessageDtoPaginationContainer } from './models/MessageDtoPaginationContainer';
export type { MudDiagramDataDto } from './models/MudDiagramDataDto';
export type { NnbDataDto } from './models/NnbDataDto';
export type { StatClusterDto } from './models/StatClusterDto';
export type { StatOperationsDto } from './models/StatOperationsDto';
export type { StatOperationsDtoPlanFactBase } from './models/StatOperationsDtoPlanFactBase';
export type { StatSectionDto } from './models/StatSectionDto';
export type { StatWellDto } from './models/StatWellDto';
export type { TelemetryInfoDto } from './models/TelemetryInfoDto';
export type { TelemetryMessageDto } from './models/TelemetryMessageDto';
export type { TelemetryOperationDto } from './models/TelemetryOperationDto';
@ -32,8 +36,6 @@ export type { WellDto } from './models/WellDto';
export type { WellOperationCategoryDto } from './models/WellOperationCategoryDto';
export type { WellOperationDto } from './models/WellOperationDto';
export type { WellOperationDtoPaginationContainer } from './models/WellOperationDtoPaginationContainer';
export type { WellSectionDto } from './models/WellSectionDto';
export type { WellStatDto } from './models/WellStatDto';
export { AuthService } from './services/AuthService';
export { ClusterService } from './services/ClusterService';
@ -48,5 +50,5 @@ export { ReportService } from './services/ReportService';
export { TelemetryAnalyticsService } from './services/TelemetryAnalyticsService';
export { TelemetryService } from './services/TelemetryService';
export { WellOperationService } from './services/WellOperationService';
export { WellSectionService } from './services/WellSectionService';
export { WellOperationStatService } from './services/WellOperationStatService';
export { WellService } from './services/WellService';

View File

@ -1,16 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { WellDto } from './WellDto';
import type { WellStatDto } from './WellStatDto';
export type ClusterStatDto = {
id?: number;
caption?: string | null;
description?: string | null;
latitude?: number | null;
longitude?: number | null;
wells?: Array<WellDto> | null;
wellsStat?: Array<WellStatDto> | null;
}

View File

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { StatWellDto } from './StatWellDto';
export type StatClusterDto = {
id?: number;
caption?: string | null;
statsWells?: Array<StatWellDto> | null;
}

View File

@ -0,0 +1,16 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type StatOperationsDto = {
start?: string;
end?: string;
wellDepthStart?: number;
wellDepthEnd?: number;
routeSpeed?: number;
rop?: number;
bhaUpSpeed?: number;
bhaDownSpeed?: number;
casingDownSpeed?: number;
nonProductiveHours?: number;
}

View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { StatOperationsDto } from './StatOperationsDto';
export type StatOperationsDtoPlanFactBase = {
plan?: StatOperationsDto;
fact?: StatOperationsDto;
}

View File

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { StatOperationsDto } from './StatOperationsDto';
export type StatSectionDto = {
plan?: StatOperationsDto;
fact?: StatOperationsDto;
id?: number;
caption?: string | null;
}

View File

@ -0,0 +1,16 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CompanyDto } from './CompanyDto';
import type { StatOperationsDtoPlanFactBase } from './StatOperationsDtoPlanFactBase';
import type { StatSectionDto } from './StatSectionDto';
export type StatWellDto = {
id?: number;
caption?: string | null;
wellType?: string | null;
sections?: Array<StatSectionDto> | null;
total?: StatOperationsDtoPlanFactBase;
companies?: Array<CompanyDto> | null;
}

View File

@ -1,22 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type WellSectionDto = {
id?: number;
sectionType?: string | null;
wellDepthPlan?: number;
wellDepthFact?: number;
durationPlan?: number;
durationFact?: number;
mechSpeedPlan?: number;
mechSpeedFact?: number;
routeSpeedPlan?: number;
routeSpeedFact?: number;
bhaUpSpeedPlan?: number;
bhaUpSpeedFact?: number;
bhaDownSpeedPlan?: number;
bhaDownSpeedFact?: number;
casingDownSpeedPlan?: number;
casingDownSpeedFact?: number;
}

View File

@ -1,27 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CompanyDto } from './CompanyDto';
import type { WellSectionDto } from './WellSectionDto';
export type WellStatDto = {
caption?: string | null;
cluster?: string | null;
deposit?: string | null;
id?: number;
latitude?: number | null;
longitude?: number | null;
wellType?: string | null;
planStart?: string | null;
planEnd?: string | null;
factStart?: string | null;
factEnd?: string | null;
unProductiveDays?: number | null;
rateOfPenetrationPlan?: number | null;
rateOfPenetrationFact?: number | null;
routeSpeedPlan?: number | null;
routeSpeedFact?: number | null;
sections?: Array<WellSectionDto> | null;
companies?: Array<CompanyDto> | null;
}

View File

@ -2,7 +2,6 @@
/* tslint:disable */
/* eslint-disable */
import type { ClusterDto } from '../models/ClusterDto';
import type { ClusterStatDto } from '../models/ClusterStatDto';
import type { WellDto } from '../models/WellDto';
import { request as __request } from '../core/request';
@ -37,20 +36,4 @@ idCluster: number,
return result.body;
}
/**
* Получение обопщенной статистики по кусту (лучшая/худшая скважина)
* @param idCluster
* @returns ClusterStatDto Success
* @throws ApiError
*/
public static async getStat(
idCluster: number,
): Promise<ClusterStatDto> {
const result = await __request({
method: 'GET',
path: `/api/cluster/${idCluster}/Stat`,
});
return result.body;
}
}

View File

@ -32,6 +32,8 @@ idWell: string,
* @param operationCategoryIds фильтр по списку id категорий операции
* @param begin фильтр по началу операции
* @param end фильтр по окончанию операции
* @param minDepth фильтр по минимальной глубине скважины
* @param maxDepth фильтр по максимальной глубине скважины
* @param skip
* @param take
* @returns WellOperationDtoPaginationContainer Success
@ -44,6 +46,8 @@ sectionTypeIds?: Array<number>,
operationCategoryIds?: Array<number>,
begin?: string,
end?: string,
minDepth: number = -1.7976931348623157e+308,
maxDepth: number = 1.7976931348623157e+308,
skip?: number,
take: number = 32,
): Promise<WellOperationDtoPaginationContainer> {
@ -56,6 +60,8 @@ take: number = 32,
'operationCategoryIds': operationCategoryIds,
'begin': begin,
'end': end,
'minDepth': minDepth,
'maxDepth': maxDepth,
'skip': skip,
'take': take,
},

View File

@ -0,0 +1,40 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { StatClusterDto } from '../models/StatClusterDto';
import type { StatWellDto } from '../models/StatWellDto';
import { request as __request } from '../core/request';
export class WellOperationStatService {
/**
* @param idCluster
* @returns StatClusterDto Success
* @throws ApiError
*/
public static async getStatCluster(
idCluster: number,
): Promise<StatClusterDto> {
const result = await __request({
method: 'GET',
path: `/api/cluster/${idCluster}/stat`,
});
return result.body;
}
/**
* @param idWell
* @returns StatWellDto Success
* @throws ApiError
*/
public static async getStatWell(
idWell: number,
): Promise<StatWellDto> {
const result = await __request({
method: 'GET',
path: `/api/well/${idWell}/stat`,
});
return result.body;
}
}

View File

@ -1,41 +0,0 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { WellSectionDto } from '../models/WellSectionDto';
import { request as __request } from '../core/request';
export class WellSectionService {
/**
* @param idWell
* @returns WellSectionDto Success
* @throws ApiError
*/
public static async getSectionsByWellId(
idWell: number,
): Promise<Array<WellSectionDto>> {
const result = await __request({
method: 'GET',
path: `/api/well/${idWell}/sections`,
});
return result.body;
}
/**
* @param idWell
* @param idSection
* @returns WellSectionDto Success
* @throws ApiError
*/
public static async get(
idWell: number,
idSection: number,
): Promise<WellSectionDto> {
const result = await __request({
method: 'GET',
path: `/api/well/${idWell}/sections/${idSection}`,
});
return result.body;
}
}