From ac987546b32d5ddbf980fa69762a472e52696c11 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Thu, 26 Aug 2021 11:05:30 +0500 Subject: [PATCH] CF2-55: Added data to cluster info tables --- src/pages/ClusterInfo.jsx | 40 ++++-- src/pages/ClusterSections.jsx | 128 +++++++++++------- src/pages/ClusterWells.jsx | 119 +++++++--------- src/pages/WellOperations/WellSectionsStat.jsx | 4 +- src/services/api/index.ts | 10 +- src/services/api/models/ClusterStatDto.ts | 16 --- src/services/api/models/StatClusterDto.ts | 11 ++ src/services/api/models/StatOperationsDto.ts | 16 +++ .../models/StatOperationsDtoPlanFactBase.ts | 10 ++ src/services/api/models/StatSectionDto.ts | 12 ++ src/services/api/models/StatWellDto.ts | 16 +++ src/services/api/models/WellSectionDto.ts | 22 --- src/services/api/models/WellStatDto.ts | 27 ---- src/services/api/services/ClusterService.ts | 17 --- .../api/services/WellOperationService.ts | 6 + .../api/services/WellOperationStatService.ts | 40 ++++++ .../api/services/WellSectionService.ts | 41 ------ 17 files changed, 275 insertions(+), 260 deletions(-) delete mode 100644 src/services/api/models/ClusterStatDto.ts create mode 100644 src/services/api/models/StatClusterDto.ts create mode 100644 src/services/api/models/StatOperationsDto.ts create mode 100644 src/services/api/models/StatOperationsDtoPlanFactBase.ts create mode 100644 src/services/api/models/StatSectionDto.ts create mode 100644 src/services/api/models/StatWellDto.ts delete mode 100644 src/services/api/models/WellSectionDto.ts delete mode 100644 src/services/api/models/WellStatDto.ts create mode 100644 src/services/api/services/WellOperationStatService.ts delete mode 100644 src/services/api/services/WellSectionService.ts diff --git a/src/pages/ClusterInfo.jsx b/src/pages/ClusterInfo.jsx index 587c551..d31aa03 100644 --- a/src/pages/ClusterInfo.jsx +++ b/src/pages/ClusterInfo.jsx @@ -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(<> @@ -25,16 +41,18 @@ export default function ClusterInfo() { - - - - - - - - - - + + + + + + + + + + + + ) } \ No newline at end of file diff --git a/src/pages/ClusterSections.jsx b/src/pages/ClusterSections.jsx index 63079ed..3979723 100644 --- a/src/pages/ClusterSections.jsx +++ b/src/pages/ClusterSections.jsx @@ -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) => - item.map((company) => {company.caption}), + item?.map((company) => {company.caption}), }, ] -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 ( <> { - 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) => () @@ -117,15 +101,14 @@ export default function Cluster() { ]; return ( - -
record.id} - className={'mt-20px'} - /> - ) +
record.id} + className={'mt-20px'} + /> + ) } \ No newline at end of file diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx index 9620edb..8843dee 100644 --- a/src/pages/WellOperations/WellSectionsStat.jsx +++ b/src/pages/WellOperations/WellSectionsStat.jsx @@ -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) diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 5b12400..63c83a4 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -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'; diff --git a/src/services/api/models/ClusterStatDto.ts b/src/services/api/models/ClusterStatDto.ts deleted file mode 100644 index 911a264..0000000 --- a/src/services/api/models/ClusterStatDto.ts +++ /dev/null @@ -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 | null; - wellsStat?: Array | null; -} \ No newline at end of file diff --git a/src/services/api/models/StatClusterDto.ts b/src/services/api/models/StatClusterDto.ts new file mode 100644 index 0000000..8f18c1a --- /dev/null +++ b/src/services/api/models/StatClusterDto.ts @@ -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 | null; +} \ No newline at end of file diff --git a/src/services/api/models/StatOperationsDto.ts b/src/services/api/models/StatOperationsDto.ts new file mode 100644 index 0000000..6941292 --- /dev/null +++ b/src/services/api/models/StatOperationsDto.ts @@ -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; +} \ No newline at end of file diff --git a/src/services/api/models/StatOperationsDtoPlanFactBase.ts b/src/services/api/models/StatOperationsDtoPlanFactBase.ts new file mode 100644 index 0000000..b15856d --- /dev/null +++ b/src/services/api/models/StatOperationsDtoPlanFactBase.ts @@ -0,0 +1,10 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { StatOperationsDto } from './StatOperationsDto'; + +export type StatOperationsDtoPlanFactBase = { + plan?: StatOperationsDto; + fact?: StatOperationsDto; +} \ No newline at end of file diff --git a/src/services/api/models/StatSectionDto.ts b/src/services/api/models/StatSectionDto.ts new file mode 100644 index 0000000..ec2edfe --- /dev/null +++ b/src/services/api/models/StatSectionDto.ts @@ -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; +} \ No newline at end of file diff --git a/src/services/api/models/StatWellDto.ts b/src/services/api/models/StatWellDto.ts new file mode 100644 index 0000000..c197002 --- /dev/null +++ b/src/services/api/models/StatWellDto.ts @@ -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 | null; + total?: StatOperationsDtoPlanFactBase; + companies?: Array | null; +} \ No newline at end of file diff --git a/src/services/api/models/WellSectionDto.ts b/src/services/api/models/WellSectionDto.ts deleted file mode 100644 index f53fced..0000000 --- a/src/services/api/models/WellSectionDto.ts +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/src/services/api/models/WellStatDto.ts b/src/services/api/models/WellStatDto.ts deleted file mode 100644 index 7293b43..0000000 --- a/src/services/api/models/WellStatDto.ts +++ /dev/null @@ -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 | null; - companies?: Array | null; -} \ No newline at end of file diff --git a/src/services/api/services/ClusterService.ts b/src/services/api/services/ClusterService.ts index da970cc..5c6dada 100644 --- a/src/services/api/services/ClusterService.ts +++ b/src/services/api/services/ClusterService.ts @@ -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 { - const result = await __request({ - method: 'GET', - path: `/api/cluster/${idCluster}/Stat`, - }); - return result.body; - } - } \ No newline at end of file diff --git a/src/services/api/services/WellOperationService.ts b/src/services/api/services/WellOperationService.ts index 94be3ed..0fdbd49 100644 --- a/src/services/api/services/WellOperationService.ts +++ b/src/services/api/services/WellOperationService.ts @@ -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, operationCategoryIds?: Array, begin?: string, end?: string, +minDepth: number = -1.7976931348623157e+308, +maxDepth: number = 1.7976931348623157e+308, skip?: number, take: number = 32, ): Promise { @@ -56,6 +60,8 @@ take: number = 32, 'operationCategoryIds': operationCategoryIds, 'begin': begin, 'end': end, + 'minDepth': minDepth, + 'maxDepth': maxDepth, 'skip': skip, 'take': take, }, diff --git a/src/services/api/services/WellOperationStatService.ts b/src/services/api/services/WellOperationStatService.ts new file mode 100644 index 0000000..dda001d --- /dev/null +++ b/src/services/api/services/WellOperationStatService.ts @@ -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 { + 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 { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/stat`, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/WellSectionService.ts b/src/services/api/services/WellSectionService.ts deleted file mode 100644 index 9fb6950..0000000 --- a/src/services/api/services/WellSectionService.ts +++ /dev/null @@ -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> { - 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 { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/sections/${idSection}`, - }); - return result.body; - } - -} \ No newline at end of file