import { ApiClientFactory } from "../core"; import { PersonCountTrend, PersonOverview, RealtimePersonWorker, SiteDisplay, TodayPersonTrend } from "../model/LaborForce.model"; export class LaborForceService { constructor(private factory: ApiClientFactory){} /** * @function loadPersonOverview 获取人员作业总览 */ async loadPersonOverview(objectId: string): Promise{ const result = await this.factory.surveillance.get(`/person/statistics/${objectId}/personWorkerOverview`); return result; } /** * @function loadPersonCountTrend 获取作业人数趋势 * @param startTime * @param endTime */ async loadPersonCountTrend(startTime: number, endTime: number, objectId: string): Promise { const result = await this.factory.surveillance.get(`/person/statistics/${objectId}/workerOverviewTrend`,{ startTime, endTime }); return result; } /** * @function loadSiteDisplay 获取作业概况 * @param startTime * @param endTime */ async loadSiteDisplay(startTime: number, endTime: number, objectId: string): Promise { const result = await this.factory.surveillance.get(`/person/statistics/${objectId}/workerOverview`, { startTime, endTime }) return result; } /** * @function loadTodayPersonTrend 今日作业人数趋势 */ async loadTodayPersonTrend(startHour: number, endHour: number, objectId: string):Promise { const result = await this.factory.surveillance.get(`/person/statistics/${objectId}/personWorkerOverviewRate`, { startHour, endHour }) return result; } /** * @function loadRealtimePersonWorker 实时作业人数 */ async loadRealtimePersonWorker(objectId: string):Promise { const result = await this.factory.surveillance.get(`/person/statistics/${objectId}/personWorkerOverviewDetail`); return result; } }