From 1a3569389e318312f47254106bcc42edf637ee96 Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 13 Oct 2021 18:04:47 +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 + .../api/models/DrillFlowChartParamsDto.ts | 21 +++ src/services/api/models/TelemetryInfoDto.ts | 3 +- .../api/services/DrillFlowChartService.ts | 124 ++++++++++++++++++ .../api/services/DrillParamsService.ts | 7 +- 5 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 src/services/api/models/DrillFlowChartParamsDto.ts create mode 100644 src/services/api/services/DrillFlowChartService.ts diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 7e1ec4c..92aad3d 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -9,6 +9,7 @@ export type { ClusterDto } from './models/ClusterDto'; export type { CompanyDto } from './models/CompanyDto'; export type { DatesRangeDto } from './models/DatesRangeDto'; export type { DepositDto } from './models/DepositDto'; +export type { DrillFlowChartParamsDto } from './models/DrillFlowChartParamsDto'; export type { DrillParamsDto } from './models/DrillParamsDto'; export type { EventDto } from './models/EventDto'; export type { FileInfoDto } from './models/FileInfoDto'; @@ -52,6 +53,7 @@ export { AdminWellService } from './services/AdminWellService'; export { AuthService } from './services/AuthService'; export { ClusterService } from './services/ClusterService'; export { DepositService } from './services/DepositService'; +export { DrillFlowChartService } from './services/DrillFlowChartService'; export { DrillingProgramService } from './services/DrillingProgramService'; export { DrillParamsService } from './services/DrillParamsService'; export { FileService } from './services/FileService'; diff --git a/src/services/api/models/DrillFlowChartParamsDto.ts b/src/services/api/models/DrillFlowChartParamsDto.ts new file mode 100644 index 0000000..9f94708 --- /dev/null +++ b/src/services/api/models/DrillFlowChartParamsDto.ts @@ -0,0 +1,21 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type DrillFlowChartParamsDto = { + id?: number; + idWell?: number; + lastUpdate?: string; + depthStart?: number; + depthEnd?: number; + axialLoadMin?: number; + axialLoadMax?: number; + pressureMin?: number; + pressureMax?: number; + rotorTorqueMin?: number; + rotorTorqueMax?: number; + rotorSpeedMin?: number; + rotorSpeedMax?: number; + flowMin?: number; + flowMax?: number; +} diff --git a/src/services/api/models/TelemetryInfoDto.ts b/src/services/api/models/TelemetryInfoDto.ts index f5c5c09..01b57bc 100644 --- a/src/services/api/models/TelemetryInfoDto.ts +++ b/src/services/api/models/TelemetryInfoDto.ts @@ -11,6 +11,7 @@ export type TelemetryInfoDto = { customer?: string | null; deposit?: string | null; hmiVersion?: string | null; - plcVersion?: string | null; + saubPlcVersion?: string | null; + spinPlcVersion?: string | null; comment?: string | null; } diff --git a/src/services/api/services/DrillFlowChartService.ts b/src/services/api/services/DrillFlowChartService.ts new file mode 100644 index 0000000..057efd7 --- /dev/null +++ b/src/services/api/services/DrillFlowChartService.ts @@ -0,0 +1,124 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { DrillFlowChartParamsDto } from '../models/DrillFlowChartParamsDto'; +import { request as __request } from '../core/request'; + +export class DrillFlowChartService { + + /** + * Возвращает все значения для корридоров бурения по id скважины + * @param idWell id скважины + * @returns DrillFlowChartParamsDto Success + * @throws ApiError + */ + public static async getAll( + idWell: number, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/drillFlowChartParams/${idWell}/paramsByIdWell`, + }); + return result.body; + } + + /** + * Возвращает все значения для корридоров бурения по uid панели + * @param idWell + * @param uid uid панели + * @returns DrillFlowChartParamsDto Success + * @throws ApiError + */ + public static async getAll1( + idWell: string, + uid?: string, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/drillFlowChartParams/${idWell}`, + query: { + 'uid': uid, + }, + }); + return result.body; + } + + /** + * Сохраняет значения для корридоров бурения + * @param idWell id скважины + * @param requestBody Параметры корридоров бурения + * @returns number Success + * @throws ApiError + */ + public static async insert( + idWell: number, + requestBody?: DrillFlowChartParamsDto, + ): Promise { + const result = await __request({ + method: 'POST', + path: `/api/drillFlowChartParams/${idWell}`, + body: requestBody, + }); + return result.body; + } + + /** + * Изменяет значения выбранного корридора бурения + * @param idWell id скважины + * @param requestBody Параметры корридоров бурения + * @returns number Success + * @throws ApiError + */ + public static async edit( + idWell: number, + requestBody?: DrillFlowChartParamsDto, + ): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/drillFlowChartParams/${idWell}`, + body: requestBody, + }); + return result.body; + } + + /** + * Удаляет значения выбранного корридора бурения + * @param idWell id скважины + * @param drillFlowChartParamsId Id объекта корридоров бурения + * @returns number Success + * @throws ApiError + */ + public static async delete( + idWell: number, + drillFlowChartParamsId?: number, + ): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/drillFlowChartParams/${idWell}`, + query: { + 'drillFlowChartParamsId': drillFlowChartParamsId, + }, + }); + return result.body; + } + + /** + * Добавляет массив объектов корридоров бурения + * @param idWell id скважины + * @param requestBody Массив объектов параметров корридоров бурения + * @returns number Success + * @throws ApiError + */ + public static async insertRange( + idWell: number, + requestBody?: Array, + ): Promise { + const result = await __request({ + method: 'POST', + path: `/api/drillFlowChartParams/${idWell}/range`, + body: requestBody, + }); + return result.body; + } + +} \ No newline at end of file diff --git a/src/services/api/services/DrillParamsService.ts b/src/services/api/services/DrillParamsService.ts index a7d0b09..3b1539a 100644 --- a/src/services/api/services/DrillParamsService.ts +++ b/src/services/api/services/DrillParamsService.ts @@ -68,17 +68,22 @@ export class DrillParamsService { /** * Изменяет значения выбранного режима бурения * @param idWell id скважины + * @param dtoId id dto для изменения * @param requestBody Параметры режимов бурений для секции * @returns number Success * @throws ApiError */ - public static async edit( + public static async update( idWell: number, + dtoId?: number, requestBody?: DrillParamsDto, ): Promise { const result = await __request({ method: 'PUT', path: `/api/drillParams/${idWell}`, + query: { + 'dtoId': dtoId, + }, body: requestBody, }); return result.body;