diff --git a/src/services/api/index.ts b/src/services/api/index.ts index 288bdbe..1e4e6e8 100644 --- a/src/services/api/index.ts +++ b/src/services/api/index.ts @@ -23,6 +23,8 @@ export type { FilePublishInfoDto } from './models/FilePublishInfoDto'; export type { MeasureDto } from './models/MeasureDto'; export type { MessageDto } from './models/MessageDto'; export type { MessageDtoPaginationContainer } from './models/MessageDtoPaginationContainer'; +export type { SetpointInfoDto } from './models/SetpointInfoDto'; +export type { SetpointsRequestDto } from './models/SetpointsRequestDto'; export type { StatClusterDto } from './models/StatClusterDto'; export type { StatOperationsDto } from './models/StatOperationsDto'; export type { StatOperationsDtoPlanFactBase } from './models/StatOperationsDtoPlanFactBase'; @@ -63,7 +65,6 @@ export { AdminUserRoleService } from './services/AdminUserRoleService'; export { AdminUserService } from './services/AdminUserService'; export { AdminWellService } from './services/AdminWellService'; export { AuthService } from './services/AuthService'; -export { ClusterOperationStatService } from './services/ClusterOperationStatService'; export { ClusterService } from './services/ClusterService'; export { DepositService } from './services/DepositService'; export { DrillFlowChartService } from './services/DrillFlowChartService'; @@ -72,13 +73,14 @@ export { DrillParamsService } from './services/DrillParamsService'; export { FileService } from './services/FileService'; export { MeasureService } from './services/MeasureService'; export { MessageService } from './services/MessageService'; +export { OperationStatService } from './services/OperationStatService'; export { ReportService } from './services/ReportService'; export { RequerstTrackerService } from './services/RequerstTrackerService'; +export { SetpointsService } from './services/SetpointsService'; 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/SetpointInfoDto.ts b/src/services/api/models/SetpointInfoDto.ts new file mode 100644 index 0000000..35fdd0a --- /dev/null +++ b/src/services/api/models/SetpointInfoDto.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type SetpointInfoDto = { + displayName?: string | null; + name?: string | null; + units?: string | null; + comment?: string | null; + max?: number; + min?: number; +} diff --git a/src/services/api/models/SetpointsRequestDto.ts b/src/services/api/models/SetpointsRequestDto.ts new file mode 100644 index 0000000..189d138 --- /dev/null +++ b/src/services/api/models/SetpointsRequestDto.ts @@ -0,0 +1,19 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { UserDto } from './UserDto'; +import type { WellDto } from './WellDto'; + +export type SetpointsRequestDto = { + id?: number; + idWell?: number; + idAuthor?: number; + idState?: number; + uploadDate?: string; + obsolescenceSec?: number; + setpoints?: Record | null; + comment?: string | null; + well?: WellDto; + author?: UserDto; +} diff --git a/src/services/api/models/WellDto.ts b/src/services/api/models/WellDto.ts index ebc03bc..a55bf12 100644 --- a/src/services/api/models/WellDto.ts +++ b/src/services/api/models/WellDto.ts @@ -13,6 +13,7 @@ export type WellDto = { longitude?: number | null; wellType?: string | null; idWellType?: number; + idCluster?: number | null; idState?: number; lastTelemetryDate?: string; telemetry?: TelemetryDto; diff --git a/src/services/api/services/ClusterOperationStatService.ts b/src/services/api/services/ClusterOperationStatService.ts deleted file mode 100644 index a15eb9b..0000000 --- a/src/services/api/services/ClusterOperationStatService.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ClusterRopStatDto } from '../models/ClusterRopStatDto'; -import { request as __request } from '../core/request'; - -export class ClusterOperationStatService { - - /** - * Формирует данные по среднему и максимальному МСП на кусту - * @param idWell id скважины с данного куста (через нее будут полуены данные) - * @returns ClusterRopStatDto Success - * @throws ApiError - */ - public static async getClusterRopStat( - idWell: number, - ): Promise { - const result = await __request({ - method: 'GET', - path: `/api/cluster/${idWell}/ropStat`, - }); - return result.body; - } - -} \ No newline at end of file diff --git a/src/services/api/services/WellOperationStatService.ts b/src/services/api/services/OperationStatService.ts similarity index 63% rename from src/services/api/services/WellOperationStatService.ts rename to src/services/api/services/OperationStatService.ts index 6019a8d..81867f1 100644 --- a/src/services/api/services/WellOperationStatService.ts +++ b/src/services/api/services/OperationStatService.ts @@ -1,12 +1,45 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ClusterRopStatDto } from '../models/ClusterRopStatDto'; import type { StatClusterDto } from '../models/StatClusterDto'; import type { StatWellDto } from '../models/StatWellDto'; import type { WellOperationDtoPlanFactPredictBase } from '../models/WellOperationDtoPlanFactPredictBase'; import { request as __request } from '../core/request'; -export class WellOperationStatService { +export class OperationStatService { + + /** + * Формирует данные по среднему и максимальному МСП на кусту по id скважины + * @param idWell id скважины с данного куста (через нее будут полуены данные) + * @returns ClusterRopStatDto Success + * @throws ApiError + */ + public static async getClusterRopStatByIdWell( + idWell: number, + ): Promise { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/ropStat`, + }); + return result.body; + } + + /** + * Формирует данные по среднему и максимальному МСП на кусту по uid панели + * @param uid id передающей данные панели + * @returns ClusterRopStatDto Success + * @throws ApiError + */ + public static async getClusterRopStatByUid( + uid: string, + ): Promise { + const result = await __request({ + method: 'GET', + path: `/api/telemetry/${uid}/ropStat`, + }); + return result.body; + } /** * Получает статстику по скважинам куста diff --git a/src/services/api/services/SetpointsService.ts b/src/services/api/services/SetpointsService.ts new file mode 100644 index 0000000..bdbf786 --- /dev/null +++ b/src/services/api/services/SetpointsService.ts @@ -0,0 +1,118 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { SetpointInfoDto } from '../models/SetpointInfoDto'; +import type { SetpointsRequestDto } from '../models/SetpointsRequestDto'; +import { request as __request } from '../core/request'; + +export class SetpointsService { + + /** + * Получает список запросов на изменение уставок. + * @param idWell + * @returns SetpointInfoDto Success + * @throws ApiError + */ + public static async getSetpointsNamesByIdWell( + idWell: number, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/setpointsNames`, + }); + return result.body; + } + + /** + * Добавляет запрос на изменение заданий панели оператора. + * @param idWell + * @param requestBody + * @returns number Success + * @throws ApiError + */ + public static async insert( + idWell: number, + requestBody?: SetpointsRequestDto, + ): Promise { + const result = await __request({ + method: 'POST', + path: `/api/well/${idWell}/setpoints`, + body: requestBody, + }); + return result.body; + } + + /** + * Получает список запросов на изменение уставок. + * @param idWell + * @returns SetpointsRequestDto Success + * @throws ApiError + */ + public static async getByIdWell( + idWell: number, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/well/${idWell}/setpoints`, + }); + return result.body; + } + + /** + * Отчет о принятии, или отклонении уставок оператором. + * После уставка будет не изменяемой. + * @param uid + * @param id + * @param requestBody можно передать только новый state eg.: {state:3} - принято + * @returns SetpointsRequestDto Success + * @throws ApiError + */ + public static async updateByTelemetryUid( + uid: string, + id: number, + requestBody?: SetpointsRequestDto, + ): Promise { + const result = await __request({ + method: 'PUT', + path: `/api/telemetry/${uid}/setpoints/${id}`, + body: requestBody, + }); + return result.body; + } + + /** + * Получает запросы на изменение уставок панели. + * !!SIDE EFFECT: изменяет состояние запросов уставок на отправлено, это не позволит удалить эти уставки после отправки на панель. + * @param uid + * @returns SetpointsRequestDto Success + * @throws ApiError + */ + public static async getByTelemetryUid( + uid: string, + ): Promise> { + const result = await __request({ + method: 'GET', + path: `/api/telemetry/${uid}/setpoints`, + }); + return result.body; + } + + /** + * Пробует удалить запрос на изменение уставок. Это будет выполнено, если запрос еще не был отправлен на панель. + * @param idWell + * @param id + * @returns any Success + * @throws ApiError + */ + public static async tryDeleteByIdWell( + idWell: number, + id: number, + ): Promise { + const result = await __request({ + method: 'DELETE', + path: `/api/well/${idWell}/setpoints/${id}`, + }); + return result.body; + } + +} \ No newline at end of file