/* * @Descripttion: * @version: * @Author: congsir * @Date: 2023-07-10 16:26:44 * @LastEditors: Please set LastEditors * @LastEditTime: 2023-08-03 09:56:58 */ import { ApiClientFactory } from '../core'; import { LedgerListReq, LedgerList, SaveLedgerReq, LedgerStatisReq, LedgerStatisRes, } from '../model/InspectionLedger.model'; export class InspectionLedgerService { constructor(private factory: ApiClientFactory) {} /** * 获取项目级巡检台账列表 * @param params */ async loadInspectionLedger(params: LedgerListReq): Promise { const result = await this.factory.surveillance.get('/dji/inspection/ledger/page', params); return result; } /** * 获取企业级巡检台账列表 * @param params */ async loadOrgInspectionLedger(params: LedgerListReq): Promise { const result = await this.factory.surveillance.get('/dji/inspection/ledger/org/page', params); return result; } /** * 保存巡检台账 * @param params */ async saveInspectionLedger(params: SaveLedgerReq) { const result = await this.factory.surveillance.post('/dji/inspection/ledger', params); return result; } /** * 删除巡检台账 * @param id */ async deleteInspectionLedger(id: string) { const result = await this.factory.surveillance.delete(`/dji/inspection/ledger/${id}`); return result; } /** * 获取GPS巡检时长 * @param id * @returns */ async loadGpsTime(id: string, happenTime: number): Promise { const result = await this.factory.surveillance.get(`/dji/inspection/ledger/inspectionTime/${id}`, { happenTime, }); return result; } /** * 获取项目级巡检台账统计 * @param param * @returns */ async loadLedgerStatis(param: LedgerStatisReq): Promise { const result = await this.factory.surveillance.get(`/dji/inspection/ledger/statistics`, param); return result; } /** * 获取企业级巡检台账统计 * @param param * @returns */ async loadOrgLedgerStatis(param: LedgerStatisReq): Promise { const result = await this.factory.surveillance.get(`/dji/inspection/ledger/org/statistics`, param); return result; } }