import { ApiClientFactory } from '../core/api.client.factory'; import { DevicesStateModal, DevicesUseCountModal, MechanicalInputLineData, MonitorStateDetailModal, ParamsVehicleLocation, VehicleDetails, VehicleLocation, VehicleLocationHistory, VehicleWorkTime, VehicleWorkTimeDetail } from '../model/vehicle.model'; export class VehicleService { constructor(private factory: ApiClientFactory) {} // 获取最近一次的车辆进出信息 async loadVehicInOut(projectId: string, inOut: string): Promise { const Today = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclegates/${inOut}/lastest` ); return Today; } // 获取今日车辆管理详情 async loadVehicDetail(projectId: string): Promise { const Today = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclegates/todayInfo` ); return Today; } // 在线设备统计(使用中,待使用) async loadDevicesUseCount(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/useCount` ); return result; } // 机械投入分析(近30天) async loadMechanicalInputLine(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/dayDeviceUseCount` ); return result; } // 按设备状态统计数量 async loadDevicesState(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/statusCount` ); return result; } // 监测状态-二级页面,明细 async loadDevicesDetail(projectId: string, status: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/list?status=${status}` ); return result; } // 工时统计 async loadVehicWorkTime(projectId: string, dayType: string): Promise { const workTimeList = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/deviceWorkTime?dayType=${dayType}` ); return workTimeList; } // 工时统计详情 async loadVehicWorkTimeDetail( projectId: string, dayType: string, deviceId: string, pageIndex: number, pageSize: number ): Promise { const workTimeList = await this.factory.entity.get( `/api//web/projects/${projectId}/vehiclePositions/${deviceId}/workTimeDetails`, { dayType, pageIndex, pageSize } ); return workTimeList; } // 获取车辆实时位置 async loadVehicLocation(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/allRealPosition` ); return result; } // 获取车辆列表 async loadVehicDeviceList(projectId: string): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/deviceList` ); return result; } // 获取车辆历史位置 async loadVehicLocationHistory(projectId: string, deviceId: string, params: ParamsVehicleLocation): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclePositions/${deviceId}/trace`, params ); return result; } // 获取数字工地,车辆闸机设备一级 async VehicleGateMachineList(projectId: string, params: any): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclegates/today/number/${params.deviceId}` ); return result; } // 获取数字工地,车辆闸机设备二级 async AccessRecordsDataByDeviceId(projectId: string, queryParams: any): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/vehiclegates/dataCenter/records`, queryParams ); return result; } }