import { ApiClientFactory } from '../core/api.client.factory'; import { WaterAccumulationModel, HydropowerList, LivingAreaDeviceAnalyzeData, GreenConstructionHydropowerData, IPhaseTotalWaterControl, IPhaseMonthWaterControl, } from '../model/waterAccumulation.model'; export class WaterAccumulationService { constructor(private factory: ApiClientFactory) {} // 获取全部水量监测 async loadWaterMonitoringOfAll(projectId: string, level: number): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/waterMeterVolumes/positionVolumes?level=${level}` ); return result; } // 获取按月水量监测 async loadWaterMonitoringOfMonth(projectId: string, year: string, month: string, level: number): Promise { const result = await this.factory.entity.get( `/api/web/projects/${projectId}/waterMeterVolumes/positionVolumes/${year}/${month}?level=${level}` ); return result; } // 获取每月用水量-全部 async loadWaterList(projectId: string, type: string, level: number): Promise { return await this.factory.entity.get(`api/web/projects/${projectId}/waterMeterLevel/waterSum?type=${type}&level=${level}`); } // 绿色施工-生活区水(电)耗量合理性分析-获取分析结果 async loadLivingAreaDeviceAnalyzeData(projectId: string, deviceType: string): Promise { const result = await this.factory.entity.get( `api/web/projects/${projectId}/livingAreaDeviceAnalyze/getLivingAreaDeviceAnalyze`, { deviceType, } ); return result; } // 绿色施工-生活区水(电)耗量合理性分析-获取设置信息 async getLivingAreaDeviceAnalyzeRecord(projectId: string, deviceType: string): Promise { const result = await this.factory.entity.get( `api/web/projects/${projectId}/livingAreaDeviceAnalyze/getRecord`, { deviceType, } ); return result; } // 绿色施工-生活区水(电)耗量合理性分析-更新设置信息 async postLivingAreaDeviceAnalyzeUpdateRecord(projectId: string, postData: any): Promise { const result = await this.factory.entity.post( `api/web/projects/${projectId}/livingAreaDeviceAnalyze/saveOrUpdateRecord`, { projectId, ...postData, } ); return result; } // 绿色施工-万元产值用水量与目标值对比 async getTenThousandYuanData(projectId: string, phaseEnum?: string, level?: number): Promise { const result = await this.factory.entity.get( `api/web/projects/${projectId}/water/saving/v2/thousandOutput/consume/compare`, { phaseEnum, level } ); return result; } // 绿色施工-各区域用水量汇总接口 async getTotalWaterData(projectId: string, phaseEnum?: string, level?: number): Promise { const result = await this.factory.entity.get( `api/web/projects/${projectId}/water/saving/v2/position/total`, { phaseEnum, level } ); return result; } // 绿色施工-各区域月用水量监测接口 async getMonthTotalWaterData( projectId: string, phaseEnum?: string, date?: string, level?: number ): Promise { const result = await this.factory.entity.get( `api/web/projects/${projectId}/water/saving/v2/position/month/total`, { phaseEnum, date, level } ); return result; } // 绿色施工-不同阶段用水总量控制 async loadPhaseTotalWaterControl(projectId: string, phaseEnum?: any, level?: number): Promise { const url = `/api/web/projects/${projectId}/water/saving/v2/construction/phase/total`; const result = await this.factory.entity.get(url, { phaseEnum, level }); return result; } // 绿色施工-不同阶段用电总量控制 async loadPhaseTotalPowerControl(projectId: string, phaseEnum?: any, level?: number): Promise { const url = `/api/web/projects/${projectId}/power/saving/v2/construction/phase/total`; const result = await this.factory.entity.get(url, { phaseEnum, level }); return result; } // 绿色施工-不同阶段月用水量监控 async loadPhaseMonthWaterControl(projectId: string, phaseEnum?: any, level?: number): Promise { const url = `/api/web/projects/${projectId}/water/saving/v2/construction/phase/month/total`; const result = await this.factory.entity.get(url, { phaseEnum, level }); return result; } // 绿色施工-不同阶段月用电量监控 async loadPhaseMonthPowerControl(projectId: string, phaseEnum?: any, level?: number): Promise { const url = `/api/web/projects/${projectId}/power/saving/v2/construction/phase/month/total`; const result = await this.factory.entity.get(url, { phaseEnum, level }); return result; } }