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,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
Tooltip} from 'antd'
|
Tooltip} from 'antd'
|
||||||
import { DataService } from '../services/api'
|
import { TelemetryDataSaubService } from '../services/api'
|
||||||
import {generateUUID} from '../services/UidGenerator'
|
import {generateUUID} from '../services/UidGenerator'
|
||||||
import { ArchiveColumn } from '../components/ArchiveColumn'
|
import { ArchiveColumn } from '../components/ArchiveColumn'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
@ -94,7 +94,7 @@ export default function Archive({idWell}) {
|
|||||||
let startDate = rangeDate[0].toISOString()
|
let startDate = rangeDate[0].toISOString()
|
||||||
|
|
||||||
setLoader(true)
|
setLoader(true)
|
||||||
DataService.getData(idWell, startDate, interval, 2048)
|
TelemetryDataSaubService.getData(idWell, startDate, interval, 2048)
|
||||||
.then(handleReceiveDataSaub)
|
.then(handleReceiveDataSaub)
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
notify(`Не удалось загрузить данные по скважине (${idWell}) c ${rangeDate[0]} по ${rangeDate[1]}`, '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 { CompanyDto } from './models/CompanyDto';
|
||||||
export type { DatesRangeDto } from './models/DatesRangeDto';
|
export type { DatesRangeDto } from './models/DatesRangeDto';
|
||||||
export type { DepositDto } from './models/DepositDto';
|
export type { DepositDto } from './models/DepositDto';
|
||||||
|
export type { DrillParamsDto } from './models/DrillParamsDto';
|
||||||
export type { EventDto } from './models/EventDto';
|
export type { EventDto } from './models/EventDto';
|
||||||
export type { FileInfoDto } from './models/FileInfoDto';
|
export type { FileInfoDto } from './models/FileInfoDto';
|
||||||
export type { FileInfoDtoPaginationContainer } from './models/FileInfoDtoPaginationContainer';
|
export type { FileInfoDtoPaginationContainer } from './models/FileInfoDtoPaginationContainer';
|
||||||
@ -49,9 +50,9 @@ export { AdminUserService } from './services/AdminUserService';
|
|||||||
export { AdminWellService } from './services/AdminWellService';
|
export { AdminWellService } from './services/AdminWellService';
|
||||||
export { AuthService } from './services/AuthService';
|
export { AuthService } from './services/AuthService';
|
||||||
export { ClusterService } from './services/ClusterService';
|
export { ClusterService } from './services/ClusterService';
|
||||||
export { DataService } from './services/DataService';
|
|
||||||
export { DepositService } from './services/DepositService';
|
export { DepositService } from './services/DepositService';
|
||||||
export { DrillingProgramService } from './services/DrillingProgramService';
|
export { DrillingProgramService } from './services/DrillingProgramService';
|
||||||
|
export { DrillParamsService } from './services/DrillParamsService';
|
||||||
export { FileService } from './services/FileService';
|
export { FileService } from './services/FileService';
|
||||||
export { MeasureService } from './services/MeasureService';
|
export { MeasureService } from './services/MeasureService';
|
||||||
export { MessageService } from './services/MessageService';
|
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) файла
|
* Импортирует операции из excel (xlsx) файла
|
||||||
* @param idWell id скважины
|
* @param idWell id скважины
|
||||||
* @param deleteWellOperationsBeforeImport Удалить операции перед импортом, если фал валидный
|
* @param options Удалить операции перед импортом = 1, если фал валидный
|
||||||
* @param requestBody
|
* @param requestBody
|
||||||
* @returns any Success
|
* @returns any Success
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
*/
|
*/
|
||||||
public static async import(
|
public static async import(
|
||||||
idWell: number,
|
idWell: number,
|
||||||
deleteWellOperationsBeforeImport: boolean = false,
|
options: number,
|
||||||
requestBody?: any,
|
requestBody?: any,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const result = await __request({
|
const result = await __request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
path: `/api/well/${idWell}/wellOperations/import`,
|
path: `/api/well/${idWell}/wellOperations/import/${options}`,
|
||||||
query: {
|
|
||||||
'deleteWellOperationsBeforeImport': deleteWellOperationsBeforeImport,
|
|
||||||
},
|
|
||||||
body: requestBody,
|
body: requestBody,
|
||||||
});
|
});
|
||||||
return result.body;
|
return result.body;
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import type { WellDto } from '../models/WellDto';
|
import type { WellDto } from '../models/WellDto';
|
||||||
import type { WellOperationDto } from '../models/WellOperationDto';
|
|
||||||
import { request as __request } from '../core/request';
|
import { request as __request } from '../core/request';
|
||||||
|
|
||||||
export class WellService {
|
export class WellService {
|
||||||
@ -19,21 +18,6 @@ export class WellService {
|
|||||||
return result.body;
|
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
|
* @returns WellDto Success
|
||||||
* @throws ApiError
|
* @throws ApiError
|
||||||
|
Loading…
Reference in New Issue
Block a user