forked from ddrilling/asb_cloud_front
remove dead controller;
update api client;
This commit is contained in:
parent
0ee72bb952
commit
2da5e7076e
@ -5,7 +5,7 @@ import {
|
||||
Row,
|
||||
Col,
|
||||
Tooltip} from 'antd'
|
||||
import { DataService } from '../services/api'
|
||||
import { TelemetryDataSaubService } from '../services/api'
|
||||
import {generateUUID} from '../services/UidGenerator'
|
||||
import { ArchiveColumn } from '../components/ArchiveColumn'
|
||||
import moment from 'moment'
|
||||
@ -94,7 +94,7 @@ export default function Archive({idWell}) {
|
||||
let startDate = rangeDate[0].toISOString()
|
||||
|
||||
setLoader(true)
|
||||
DataService.getData(idWell, startDate, interval, 2048)
|
||||
TelemetryDataSaubService.getData(idWell, startDate, interval, 2048)
|
||||
.then(handleReceiveDataSaub)
|
||||
.catch(error => {
|
||||
notify(`Не удалось загрузить данные по скважине (${idWell}) c ${rangeDate[0]} по ${rangeDate[1]}`, 'error')
|
||||
|
@ -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 { DrillParamsDto } from './models/DrillParamsDto';
|
||||
export type { EventDto } from './models/EventDto';
|
||||
export type { FileInfoDto } from './models/FileInfoDto';
|
||||
export type { FileInfoDtoPaginationContainer } from './models/FileInfoDtoPaginationContainer';
|
||||
@ -49,9 +50,9 @@ export { AdminUserService } from './services/AdminUserService';
|
||||
export { AdminWellService } from './services/AdminWellService';
|
||||
export { AuthService } from './services/AuthService';
|
||||
export { ClusterService } from './services/ClusterService';
|
||||
export { DataService } from './services/DataService';
|
||||
export { DepositService } from './services/DepositService';
|
||||
export { DrillingProgramService } from './services/DrillingProgramService';
|
||||
export { DrillParamsService } from './services/DrillParamsService';
|
||||
export { FileService } from './services/FileService';
|
||||
export { MeasureService } from './services/MeasureService';
|
||||
export { MessageService } from './services/MessageService';
|
||||
|
26
src/services/api/models/DrillParamsDto.ts
Normal file
26
src/services/api/models/DrillParamsDto.ts
Normal file
@ -0,0 +1,26 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
|
||||
export type DrillParamsDto = {
|
||||
id?: number;
|
||||
idWell?: number;
|
||||
wellSectionTypeName?: string | null;
|
||||
depthStart?: number;
|
||||
depthEnd?: 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;
|
||||
consumptionMin?: number;
|
||||
consumptionAvg?: number;
|
||||
consumptionMax?: number;
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { DatesRangeDto } from '../models/DatesRangeDto';
|
||||
import type { TelemetryDataSaubDto } from '../models/TelemetryDataSaubDto';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class DataService {
|
||||
|
||||
/**
|
||||
* Возвращает данные САУБ по скважине.
|
||||
* По умолчанию за последние 10 минут.
|
||||
* @param idWell id скважины
|
||||
* @param begin дата начала выборки. По умолчанию: текущее время - intervalSec
|
||||
* @param intervalSec интервал времени даты начала выборки, секунды
|
||||
* @param approxPointsCount желаемое количество точек. Если в выборке точек будет больше, то выборка будет прорежена.
|
||||
* @returns TelemetryDataSaubDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getData(
|
||||
idWell: number,
|
||||
begin?: string,
|
||||
intervalSec: number = 600,
|
||||
approxPointsCount: number = 1024,
|
||||
): Promise<Array<TelemetryDataSaubDto>> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/well/${idWell}/data`,
|
||||
query: {
|
||||
'begin': begin,
|
||||
'intervalSec': intervalSec,
|
||||
'approxPointsCount': approxPointsCount,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает диапазон дат сохраненных данных.
|
||||
* @param idWell id скважины
|
||||
* @returns DatesRangeDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getDataDatesRange(
|
||||
idWell: number,
|
||||
): Promise<DatesRangeDto> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/well/${idWell}/data/datesRange`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
56
src/services/api/services/DrillParamsService.ts
Normal file
56
src/services/api/services/DrillParamsService.ts
Normal file
@ -0,0 +1,56 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { DrillParamsDto } from '../models/DrillParamsDto';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class DrillParamsService {
|
||||
|
||||
/**
|
||||
* Возвращает автоматически расчитанные значения для режимов бурения
|
||||
* @param idWell id скважины
|
||||
* @param startDepth Стартовая глубина
|
||||
* @param endDepth Конечная глубина
|
||||
* @returns DrillParamsDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getDefaultDrillParams(
|
||||
idWell?: number,
|
||||
startDepth?: number,
|
||||
endDepth?: number,
|
||||
): Promise<DrillParamsDto> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/drillParams/idWell/autoParams`,
|
||||
query: {
|
||||
'idWell': idWell,
|
||||
'startDepth': startDepth,
|
||||
'endDepth': endDepth,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Сохраняет значения для режимов бурения
|
||||
* @param idWell id скважины
|
||||
* @param requestBody Параметры режимов бурений для секции
|
||||
* @returns number Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async saveDrillParams(
|
||||
idWell?: number,
|
||||
requestBody?: DrillParamsDto,
|
||||
): Promise<number> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/drillParams/idWell`,
|
||||
query: {
|
||||
'idWell': idWell,
|
||||
},
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
}
|
@ -148,22 +148,19 @@ idOperation: number,
|
||||
/**
|
||||
* Импортирует операции из excel (xlsx) файла
|
||||
* @param idWell id скважины
|
||||
* @param deleteWellOperationsBeforeImport Удалить операции перед импортом, если фал валидный
|
||||
* @param options Удалить операции перед импортом = 1, если фал валидный
|
||||
* @param requestBody
|
||||
* @returns any Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async import(
|
||||
idWell: number,
|
||||
deleteWellOperationsBeforeImport: boolean = false,
|
||||
options: number,
|
||||
requestBody?: any,
|
||||
): Promise<any> {
|
||||
const result = await __request({
|
||||
method: 'POST',
|
||||
path: `/api/well/${idWell}/wellOperations/import`,
|
||||
query: {
|
||||
'deleteWellOperationsBeforeImport': deleteWellOperationsBeforeImport,
|
||||
},
|
||||
path: `/api/well/${idWell}/wellOperations/import/${options}`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
|
@ -2,7 +2,6 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { WellDto } from '../models/WellDto';
|
||||
import type { WellOperationDto } from '../models/WellOperationDto';
|
||||
import { request as __request } from '../core/request';
|
||||
|
||||
export class WellService {
|
||||
@ -19,21 +18,6 @@ export class WellService {
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param idWell
|
||||
* @returns WellOperationDto Success
|
||||
* @throws ApiError
|
||||
*/
|
||||
public static async getOperations(
|
||||
idWell: number,
|
||||
): Promise<Array<WellOperationDto>> {
|
||||
const result = await __request({
|
||||
method: 'GET',
|
||||
path: `/api/well/${idWell}/operations`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns WellDto Success
|
||||
* @throws ApiError
|
||||
|
Loading…
Reference in New Issue
Block a user