import { ApiClientFactory } from '../core/api.client.factory'; import { AlarmAnalysisData, ICurrentAlarmDeviceParams, ICurrentAlarmDeviceListData } from '../model/projectBrain.model'; import { IProblemDetails } from '../../definition/model/qualitySafety.model'; export class ProjectBrainService { constructor(private factory: ApiClientFactory) { } // 获取设备类型列表 async getDeviceTypeList(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/combine/deviceType`); return result; } // 查询某类设备报警数据 async getAlarmAnalysisData(projectId: string, deviceType: String): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/combine/alarmAnalysisData?deviceType=${deviceType}`); return result; } // 获取当前报警设备列表 async getCurrentAlarmDeviceList(projectId: string, params: ICurrentAlarmDeviceParams): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/combine/currentAlarm`, params); return result; } // 安全一览 async getSafetyOverview(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/safety/appOverview`); return result; } // 安全一览详情 async getSafetyOverviewDetail(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/safety/overviewDetails`); return result; } // 质量一览 async getQualityOverview(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/qualitys/appOverview`); return result; } // 质量一览详情 async getQualitysOverviewDetail(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/qualitys/overviewDetails`); return result; } // 技术一览 async getTechnologyGlance(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/bimtech/projectBrain/techOverview`); return result; } // 报警百分比设置 async loadSetingStandard(projectId: string, schemePassRate?: number, blueImplementedRate?: number): Promise { const result = await this.factory.gssApi.post(`/web/projects/${projectId}/bimtech/projectBrain/setting/saveOrUpdate`, { schemePassRate, blueImplementedRate }); return result; } // 报警设置信息获取 async loadGetStandardValue(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/bimtech/projectBrain/setting/get`); return result; } // 获取生产要素一览 async loadGetFactorsValue(projectId: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/essentialFactor/projectBrain/overview`); return result; } // 工程完成情况 async loadGetCompleteInfos(projectId: string): Promise { const result = await this.factory.gssApi.get(`/gss/bimproduct/projects/${projectId}/bim5dCompleteInfos`); return result; } // 获取报警设备类别 async getAlarmDeviceType(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/combine/alarm/deviceType`); return result; } // 获取声音设置信息 async getVoice(projectId: string): Promise { const result = await this.factory.entity.get(`/api/web/projects/${projectId}/iod/setting/get/voice`); return result; } // 设置声音开关状态 async setVoice(projectId: string, status: string): Promise { const result = await this.factory.entity.put(`/api/web/projects/${projectId}/iod/setting/set/voice/${status}`); return result; } // 获取设备报警声音 async getAlarmVoice(projectId: string, deviceType: any): Promise { const result = await this.factory.entity.post(`/api/web/projects/${projectId}/iod/setting/get/sound/batch`, deviceType); return result; } // 质量一览二级 async getQualityDetails(projectId: string, type: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/qualitys/appOverview/details?type=${type}`); return result; } // 安全一览二级 async getSafetyDetails(projectId: string, type: string): Promise { const result = await this.factory.gssApi.get(`/web/projects/${projectId}/safety/appOverview/details?type=${type}`); return result; } // 智能物联报警分析二级 async getDeviceAlarmData(projectId: string, type: string, params: any): Promise { const url = `/api/web/projects/${projectId}/${type}/alarmsOfOneDay`; const result = await this.factory.entity.get(url, params); return result; } }