From 279b375ea9706112178698cb80ce6e126c4e7b09 Mon Sep 17 00:00:00 2001 From: goodmice Date: Tue, 12 Oct 2021 15:28:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B2=D0=B8=D1=81=D1=8B=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/api/index.ts | 2 + src/services/api/models/DrillParamsDto.ts | 14 ++-- src/services/api/models/WellCompositeDto.ts | 9 +++ .../api/services/DrillParamsService.ts | 71 ++++++++++++++++--- src/services/api/services/MeasureService.ts | 15 ---- src/services/api/services/TelemetryService.ts | 21 ------ .../api/services/WellCompositeService.ts | 44 ++++++++++++ 7 files changed, 124 insertions(+), 52 deletions(-) create mode 100644 src/services/api/models/WellCompositeDto.ts create mode 100644 src/services/api/services/WellCompositeService.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 8ea0eaf..7e1ec4c 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -33,6 +33,7 @@ export type { TelemetryUserDto } from './models/TelemetryUserDto'; export type { UserDto } from './models/UserDto'; export type { UserRoleDto } from './models/UserRoleDto'; export type { UserTokenDto } from './models/UserTokenDto'; +export type { WellCompositeDto } from './models/WellCompositeDto'; export type { WellDepthToDayDto } from './models/WellDepthToDayDto'; export type { WellDepthToIntervalDto } from './models/WellDepthToIntervalDto'; export type { WellDto } from './models/WellDto'; @@ -61,6 +62,7 @@ export { TelemetryAnalyticsService } from './services/TelemetryAnalyticsService' export { TelemetryDataSaubService } from './services/TelemetryDataSaubService'; export { TelemetryDataSpinService } from './services/TelemetryDataSpinService'; export { TelemetryService } from './services/TelemetryService'; +export { WellCompositeService } from './services/WellCompositeService'; export { WellOperationService } from './services/WellOperationService'; export { WellOperationStatService } from './services/WellOperationStatService'; export { WellService } from './services/WellService'; diff --git a/src/services/api/models/DrillParamsDto.ts b/src/services/api/models/DrillParamsDto.ts index 24d5751..406c87a 100644 --- a/src/services/api/models/DrillParamsDto.ts +++ b/src/services/api/models/DrillParamsDto.ts @@ -5,21 +5,21 @@ export type DrillParamsDto = { id?: number; idWell?: number; - wellSectionTypeName?: string | null; depthStart?: number; depthEnd?: number; + idWellSectionType?: number; axialLoadMin?: number; axialLoadAvg?: number; axialLoadMax?: number; pressureMin?: number; pressureAvg?: number; pressureMax?: number; - topDriveTorqueMin?: number; - topDriveTorqueAvg?: number; - topDriveTorqueMax?: number; - topDriveSpeedMin?: number; - topDriveSpeedAvg?: number; - topDriveSpeedMax?: number; + rotorTorqueMin?: number; + rotorTorqueAvg?: number; + rotorTorqueMax?: number; + rotorSpeedMin?: number; + rotorSpeedAvg?: number; + rotorSpeedMax?: number; flowMin?: number; flowAvg?: number; flowMax?: number; diff --git a/src/services/api/models/WellCompositeDto.ts b/src/services/api/models/WellCompositeDto.ts new file mode 100644 index 0000000..2db927d --- /dev/null +++ b/src/services/api/models/WellCompositeDto.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type WellCompositeDto = { + idWell?: number; + idWellSrc?: number; + idWellSectionType?: number; +} diff --git a/src/services/api/services/DrillParamsService.ts b/src/services/api/services/DrillParamsService.ts index 4c5266d..9c1cfd2 100644 --- a/src/services/api/services/DrillParamsService.ts +++ b/src/services/api/services/DrillParamsService.ts @@ -14,14 +14,14 @@ export class DrillParamsService { * @returns DrillParamsDto Success * @throws ApiError */ - public static async getDefaultDrillParams( + public static async getDefault( idWell?: number, startDepth?: number, endDepth?: number, ): Promise { const result = await __request({ method: 'GET', - path: `/drillParams/idWell/autoParams`, + path: `/autoParams`, query: { 'idWell': idWell, 'startDepth': startDepth, @@ -32,25 +32,78 @@ export class DrillParamsService { } /** - * Сохраняет значения для режимов бурения + * Возвращает все значения для режимов бурения на скважине + * @param idWell id скважины + * @returns DrillParamsDto Success + * @throws ApiError + */ + public static async getAll( + idWell: number, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/drillParams/${idWell}`, + }); + return result.body; + } + + /** + * Сохраняет значения для режимов бурения по секции на скважине * @param idWell id скважины * @param requestBody Параметры режимов бурений для секции * @returns number Success * @throws ApiError */ - public static async saveDrillParams( - idWell?: number, + public static async save( + idWell: number, requestBody?: DrillParamsDto, ): Promise { const result = await __request({ method: 'POST', - path: `/drillParams/idWell`, - query: { - 'idWell': idWell, - }, + path: `/api/drillParams/${idWell}`, body: requestBody, }); return result.body; } + /** + * Изменяет значения выбранного режима бурения + * @param idWell id скважины + * @param requestBody Параметры режимов бурений для секции + * @returns number Success + * @throws ApiError + */ + public static async edit( + idWell: number, + requestBody?: DrillParamsDto, + ): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/drillParams/${idWell}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удаляет объект значений выбранного режима бурения + * @param idWell id скважины + * @param drillParamsId Id объекта параметров режима бурений для секции + * @returns number Success + * @throws ApiError + */ + public static async delete( + idWell: number, + drillParamsId?: number, + ): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/drillParams/${idWell}`, + query: { + 'drillParamsId': drillParamsId, + }, + }); + return result.body; + } + } \ No newline at end of file diff --git a/src/services/api/services/MeasureService.ts b/src/services/api/services/MeasureService.ts index 9a70e75..6f59d4a 100644 --- a/src/services/api/services/MeasureService.ts +++ b/src/services/api/services/MeasureService.ts @@ -21,21 +21,6 @@ export class MeasureService { return result.body; } - /** - * @param idWell - * @returns any Success - * @throws ApiError - */ - public static async getAllLast( - idWell: number, - ): Promise { - const result = await __request({ - method: 'GET', - path: `/api/well/${idWell}/measure/lastAll`, - }); - return result.body; - } - /** * @param idWell * @param idCategory diff --git a/src/services/api/services/TelemetryService.ts b/src/services/api/services/TelemetryService.ts index 9ff2d4b..c00b1c8 100644 --- a/src/services/api/services/TelemetryService.ts +++ b/src/services/api/services/TelemetryService.ts @@ -2,7 +2,6 @@ /* tslint:disable */ /* eslint-disable */ import type { EventDto } from '../models/EventDto'; -import type { TelemetryDataSaubDto } from '../models/TelemetryDataSaubDto'; import type { TelemetryInfoDto } from '../models/TelemetryInfoDto'; import type { TelemetryMessageDto } from '../models/TelemetryMessageDto'; import type { TelemetryUserDto } from '../models/TelemetryUserDto'; @@ -29,26 +28,6 @@ export class TelemetryService { return result.body; } - /** - * @deprecated - * Принимает данные от разных систем по скважине - * @param uid Уникальный идентификатор отправителя - * @param requestBody Данные - * @returns any Success - * @throws ApiError - */ - public static async postData( - uid: string, - requestBody?: Array, - ): Promise { - const result = await __request({ - method: 'POST', - path: `/api/telemetry/${uid}/data`, - body: requestBody, - }); - return result.body; - } - /** * Принимает список новых сообщений от телеметрии * @param uid Уникальный идентификатор отправителя diff --git a/src/services/api/services/WellCompositeService.ts b/src/services/api/services/WellCompositeService.ts new file mode 100644 index 0000000..05eb0ae --- /dev/null +++ b/src/services/api/services/WellCompositeService.ts @@ -0,0 +1,44 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { WellCompositeDto } from '../models/WellCompositeDto'; +import { request as __request } from '../core/request'; + +export class WellCompositeService { + + /** + * Получает композитную скважину для скважины + * @param idWell id скважины для которой собрана композитная скважина + * @returns WellCompositeDto Success + * @throws ApiError + */ + public static async get( + idWell: number, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/composite`, + }); + return result.body; + } + + /** + * Создает или заменяет композитную скважину для скважины с idWell + * @param idWell id скважины для которой собрана композитная скважина + * @param requestBody Секции композитной скважины + * @returns any Success + * @throws ApiError + */ + public static async save( + idWell: number, + requestBody?: Array, + ): Promise { + const result = await __request({ + method: 'POST', + path: `/api/well/${idWell}/composite`, + body: requestBody, + }); + return result.body; + } + +} \ No newline at end of file