import { Pageable } from '../'; import { ApiClientFactory } from '../core/api.client.factory'; import { GroupsData, CreateGroup, ReqLocations, GroupLocations, ArDevices, StaticInfo, WeatherData, WarnStatic, WarnLineStatic, DeviceEventWarnStatic, DeviceEventWarnTendencyStatic, DeviceManPowerStatic, HawkeyeDeviceReq, HawkeyeDevicesData, Positon3DReq, ComposePanoramaShotProps, FetchPanoramaShotProps, PanoramaShotModel, FetchAutoCaptureList, AutoCaptureList, ArpanoramaImages, PanoramaParams, PanoramaGroupData, VrPanoOrgModel, } from '../model/ArConfig.model'; export class ArConfigService { constructor(private factory: ApiClientFactory) {} public apiClientFactory: ApiClientFactory; /** * @function fetchArGroups 获取Ar分组信息 * @param projectId 项目ID */ async fetchArGroups(projectId: string): Promise { const url = `/ar/projects/${projectId}/groups`; const result = await this.factory.surveillance.get(url); return result; } /** * @function deleteArGroup 删除Ar分组 * @param projectId 项目ID * @param id 数据ID */ async deleteArGroup(projectId: string, id: string): Promise { return await this.factory.surveillance.delete(`/ar/projects/${projectId}/groups/${id}`); } /** * @function createArGroup 添加修改群组信息 * @param projectId 项目ID * @param group 具体参数查看CreateGroup */ async createArGroup(projectId: string, group: CreateGroup): Promise { const result = await this.factory.surveillance.put(`/ar/projects/${projectId}/groups`, group); return result; } /** * @function addArLocations 添加坐标信息 * @param req 具体参数查看ReqLocations */ async addArLocations(req: ReqLocations): Promise { const result = await this.factory.surveillance.put(`/ar/maps`, req); return result; } /** * @function loadArGroupLocations 获取某组下的所有坐标信息 * @param groupId 组ID */ async loadArGroupLocations(groupId: string): Promise { const result = await this.factory.surveillance.get(`/ar/maps/${groupId}`); return result; } /** * @function loadArDevices 获取对应组下的设备 * @param groupId 组ID */ async loadArDevices(projectId: string, groupId: string): Promise { const result = await this.factory.surveillance.get(`/ar/maps/devices/candidate`, { groupId, projectId, }); return result; } /** * 获取AI事件统计率 * @param projectId */ async loadEventStatic(projectId: string): Promise { const result = await this.factory.surveillance.get(`/device/statistics/ar`, { projectId, }); return result; } /** * 获取天气信息 * @param projectId */ async loadWeather(projectId: string): Promise { const result = await this.factory.surveillance.get(`/ar/maps/${projectId}/weather`); return result; } /** * 按地点,获取设备事件预警信息 * @param projectId */ async loadDeviceEventStaticAddress(projectId: string): Promise { const result = await this.factory.surveillance.get(`/device/statistics/projectCameraEventNum`, { projectId, }); return result; } /** * 按类型,获取设备事件预警信息 * @param projectId */ async loadDeviceEventStaticType(projectId: string, dateType: number): Promise { const result = await this.factory.surveillance.get( `/device/statistics/projectDeviceHistoryTotalWranInfo`, { projectId, dateType } ); return result; } /** * 按地点,获取预警趋势 * @param projectId */ async loadWarnStaticLineAddress(projectId: string): Promise { const result = await this.factory.surveillance.get( `/device/statistics/projectCameraEventNumTrend`, { projectId } ); return result; } /** * 按类型,获取预警趋势 * @param projectId */ async loadWarnStaticLineType(projectId: string): Promise { const result = await this.factory.surveillance.get(`/device/statistics/projectEventNumTrend`, { projectId, }); return result; } /** * 获取今日设备预警 * @param projectId * @param deviceId */ async loadDeviceEventWarnStatic( projectId: string, deviceId?: string, deviceIds?: string ): Promise { if (deviceIds) { const result = await this.factory.surveillance.get(`/ar/maps/deviceEventStatistics`, { projectId, deviceIds, }); return result; } else { const result = await this.factory.surveillance.get(`/ar/maps/deviceEventStatistics`, { projectId, deviceId, }); return result; } } /** * 获取今日设备预警趋势 * @param projectId * @param deviceId */ async loadDeviceEventWarnTendencyStatic( projectId: string, deviceId?: string, deviceIds?: string ): Promise { if (deviceIds) { const result = await this.factory.surveillance.get( `/ar/maps/deviceEventTendencyStatistics`, { projectId, deviceIds, } ); return result; } else { const result = await this.factory.surveillance.get( `/ar/maps/deviceEventTendencyStatistics`, { projectId, deviceId, } ); return result; } } /** * 获取劳动力分析趋势统计 * @param projectId * @param deviceId * @param startHour 开始时间 * @param endHour 结束时间 */ //单个设备 async loadDeviceManPowerStatic( projectId: string, deviceId: string, startHour: number, endHour: number ): Promise { const result = await this.factory.surveillance.get(`/ar/maps/manpowerAnalysis`, { projectId, deviceId, startHour, endHour, }); return result; } //四个设备 async loadDeviceManPowerStaticall( projectId: string, startHour: number, endHour: number, deviceIds: string ): Promise { const result = await this.factory.surveillance.get(`/ar/maps/manpowerAnalysis`, { projectId, startHour, endHour, deviceIds, }); return result; } /** * 获取劳动力分析实时统计 * @param projectId * @param deviceId */ async loadDeviceManPowerRealTimeStatic(projectId: string, deviceId?: string, deviceIds?: string): Promise { if (deviceIds) { const result = await this.factory.surveillance.get(`/ar/maps/manpowerAnalysis/realTime`, { projectId, deviceIds, }); return result; } else { const result = await this.factory.surveillance.get(`/ar/maps/manpowerAnalysis/realTime`, { projectId, deviceId, }); return result; } } /** * 720度全景展示 * @param projectId * @param deviceId * @param deviceIds */ async panoramaImages(projectId: string, deviceId?: string, deviceIds?: string): Promise { if (deviceIds) { const result = await this.factory.surveillance.get(`/ar/maps/panoramaImages`, { projectId, deviceIds, }); return result; } else { const result = await this.factory.surveillance.get(`/ar/maps/panoramaImages`, { projectId, deviceId, }); return result; } } /** * 创建和修改鹰眼摄像机 * @param hawkeyeDeviceReq */ async createHawkeyeDevice(hawkeyeDeviceReq: HawkeyeDeviceReq): Promise { const result = await this.factory.surveillance.put(`/ar/device/relations`, hawkeyeDeviceReq); return result; } /** * 获取鹰眼摄像机列表 * @param projectId 项目ID */ async loadHawkeyeDevices(projectId: string, groupId: string): Promise { const result = await this.factory.surveillance.get(`/ar/device/relations/list`, { projectId, groupId, }); return result; } /** * 删除鹰眼摄像机 * @param deviceId */ async deleteHawkeyeDevice(deviceId: string): Promise { const result = await this.factory.surveillance.delete(`/ar/device/relations/${deviceId}`); return result; } /** * 设置3D定位画面 * @param param 定位信息 * @returns */ async setArPositon3D(param: Positon3DReq) { return await this.factory.surveillance.put(`/ysy/ptz/position3D`, param); } /** * @合成全景图 */ /** * @name 提交/修改 */ async composePanoramaShot(projectId: string, params: ComposePanoramaShotProps) { return await this.factory.surveillance.post(`/panorama/stitch`, { projectId, ...params, }); } // /** * @漫游合成全景图 */ /** * @name 提交/修改 */ async composeRoamPanoramaShot(projectId: string, params: ComposePanoramaShotProps) { return await this.factory.surveillance.post(`/panorama/stitch/makeRoamingImage`, { projectId, ...params, }); } /** * @name 删除 */ async deletePanoramaShot(id: string) { return await this.factory.surveillance.delete(`/panorama/stitch/delete?id=${id}`); } /** * @name 查询状态接口 */ async fetchPanoramaShotStatus(id: string) { return await this.factory.surveillance.get(`/panorama/stitch/status?id=${id}`); } /** * @name 查询全景列表接口 */ async fetchPanoramaShotList(params: FetchPanoramaShotProps, group?: boolean) { if (group) { return await this.factory.surveillance.get(`/panorama/stitch/group`, params); } else { return await this.factory.surveillance.get>(`/panorama/stitch/page`, params); } } /** * @自动抓拍配置列表 */ /** * @name 自动抓拍提交/修改 */ async getAutoCaptureUpdate(params: any) { return await this.factory.surveillance.put(`/automatic/capture/update`, params); } /** * @name 取消抓拍 */ async cancelCapture(configId: string) { return await this.factory.surveillance.post(`/automatic/capture/stop/${configId}`); } /** * @name 获取自动抓拍配置列表 */ async getAutoCapture(params: FetchAutoCaptureList) { return await this.factory.surveillance.post>(`/automatic/capture/page`, params); } /** * @name 自动抓拍配置删除 */ async deleteAutoCapture(projectId: string, configId: string) { return await this.factory.surveillance.delete(`/automatic/capture/${projectId}/${configId}`); } /** * @name 自动抓拍配置删除All */ async deleteAutoCaptureAll(projectId: string, configIds: any) { return await this.factory.surveillance.delete(`/automatic/capture/delete/${projectId}?configIds=${configIds}`); } /** * @name 自动抓拍配置添加 */ async addAutoCapture(params: any) { return await this.factory.surveillance.post(`/automatic/capture/save`, params); } /** * @name 自动抓拍配置开始抓图 */ async AutoCaptureBeginPic(projectId: string, configIds: any) { return await this.factory.surveillance.post(`/automatic/capture/start`, { projectId, configIds, }); } /** * @name 自动抓拍配置下载图片 */ async AutoCaptureDownload(projectId: string, taskIds: any) { return await this.factory.surveillance.post(`/automatic/capture/downloadByIds`, { projectId, taskIds, }); } /** * @name 自动抓拍配置预览图片 */ async AutoCapturePreviewPic(projectId: string, configIds: any) { return await this.factory.surveillance.post(`/automatic/capture/preview`, { projectId, configIds, }); } /** * @name 自动抓拍合成全景图 */ async getViewPicture(projectId: string, params: any) { return await this.factory.surveillance.put(`/panorama/stitch/autoCaptureMakePanorama`, { ...params, projectId, }); } /** * @name 自动抓拍预览图片删除 */ async getViewDeletImage(projectId: string, params: any) { return await this.factory.surveillance.delete(`/automatic/capture/task/image`, { ...params, projectId, }); } /** * @name 全景文件配置 */ async update720Pano(params: PanoramaParams) { return await this.factory.surveillance.post(`/panorama/stitch/xml`, params); } /** * @name 全景文件配置 */ async completeInfo(params: any) { return await this.factory.surveillance.post(`/panorama/stitch/completeInfo`, params); } /** * @name 图片翻转 */ async turnOverImg(id: string) { const url = `/panorama/stitch/rotate?id=${id}`; const result = await this.factory.surveillance.post(url); return result; } /** * 获取企业级vr全景 */ fetchOrg720(tenantId: string, orgId: string, userId: string) { return this.factory.surveillance.post('/panorama/720vr/org', { tenantId, orgId, userId, }); } fetchPrj720(tenantId: string, projectId: string, userId: string) { return this.factory.surveillance.post('/panorama/720vr/project', { tenantId, projectId, userId, }); } }