import { ApiClientFactory } from '../core/api.client.factory'; import { IGreenConstructionTest, IBatchEvaluationProjectData, IBatchEvaluationsData, BatchPostData, ISummaryEvaluates, ISummaryEvaluatesDetail, PhaseEvaluationDataList, SelfCheckBatchStatisticsCharts, SelfCheckBatchStatisticsTable, BatchEvaluationScoreTrendCharts, IMeasuresList, IMaterialOrLandSavingList, IMeasureListItem, IMeasureItem } from '../model/greenConstruction.model'; export class GreenConstructionService { constructor(private factory: ApiClientFactory) { } /****************** 批次评价汇总 ******************/ /** * 查询批次评价汇总表格 * @param projectId 项目Id */ async loadBatchEvaluationTableData(projectId: string): Promise { const result = await this.factory.entity.get( `/api/open/web/projects/${projectId}/dataCenter/envs` ); return result; } // 批次评价汇总表新建工程列表接口 async getBatchEvaluationProjectDataList(projectId: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/search`; const data = await this.factory.gssApi.get(url); return data; } // 批次评价汇总表--- 新建工程列提交表接口 async postBatchEvaluationProjectData(projectId: string, unitName: string, constructionOrg: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/add`; const data = await this.factory.gssApi.post(url, { unitName, constructionOrg }); return data; } // 批次评价汇总表--- 新建工程编辑回填表接口 async getBatchEvaluationProjectEditData(projectId: string, id: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/search/${id}`; const data = await this.factory.gssApi.get(url); return data; } // 批次评价汇总表--- 新建工程编辑提交表接口 async postBatchEvaluationProjectEditData(projectId: string, id: string, unitName: string, constructionOrg: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/update`; const data = await this.factory.gssApi.put(url, { id, unitName, constructionOrg }); return data; } // 批次评价汇总表--- 删除单位工程接口 async batchEvaluationProjectDelete(projectId: string, id: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/delete/${id}`; const data = await this.factory.gssApi.delete(url); return data; } // 批次评价汇总表--- 批次评价汇总表接口 async getbatchEvaluatesData(projectId: string, filter?: string): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/search`; const data = await this.factory.gssApi.get(url, { filter }); return data; } // 批次评价汇总表--- 校验批次数据是否重复接口 async getIsDuplicateBatchData(projectId: string, unitProjectId: string, fillDate: string, constructionPhase: string, id?: string): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/check`; const data = await this.factory.gssApi.get(url, { unitProjectId, fillDate, constructionPhase, id }); return data; } // 批次评价汇总表--- 获取批次编号接口 async getBatchNumber(projectId: string, unitProjectId: string, uuid: string): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/get/batchNo`; const data = await this.factory.gssApi.get(url, { unitProjectId, uuid }); return data; } // 批次评价汇总表--- 校验工程名称是否重复接口 async getIsProjectNameRepeat(projectId: string, unitName: string, id?: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/check`; const data = await this.factory.gssApi.get(url, { unitName, id }); return data; } // 批次评价汇总表--- 批次编辑基本信息回填接口 async getBatchEditSeckendData(projectId: string, batchId: any): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/${batchId}/search/basic`; const data = await this.factory.gssApi.get(url); return data; } // 批次评价汇总表--- 新增保存批次接口 async saveBatchSeckendData(projectId: string, batchData: BatchPostData): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/add`; const data = await this.factory.gssApi.post(url, { ...batchData }); return data; } // 批次评价汇总表--- 修改批次接口 async editBatchSeckendData(projectId: string, batchId: string, batchData: BatchPostData): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/${batchId}/update`; const data = await this.factory.gssApi.put(url, { ...batchData }); return data; } // 批次评价汇总表--- 查看批次接口 async getBatchSeckendData(projectId: string, batchId: string): Promise { let url = `/web/projects/${projectId}/green/construction/batchEvaluates/${batchId}/search`; const data = await this.factory.gssApi.get(url); return data; } // 批次评价汇总表--- 批次删除接口 async getBatchDeleteData(projectId: string, id: any): Promise { let url = `/web/projects/${projectId}//green/construction/batchEvaluates/${id}/delete`; const data = await this.factory.gssApi.delete(url); return data; } // 批次评价汇总表--- 批次下载接口 exportBatchWorld(projectId: string, batchId: string) { this.factory.gssApi.exportFile(`/web/projects/${projectId}/green/construction/batchEvaluates/${batchId}/downloadWord`); } // 单位工程评价汇总列表接口 async loadSummaryEvaluates(projectId: string, filter?: any): Promise { let url = `/web/projects/${projectId}/green/construction/summaryEvaluates/search`; const data = await this.factory.gssApi.get(url, {filter}); return data; } // 单位工程评价汇总下载 async UnitProjectDownloadWord(projectId: string, summaryId: string): Promise { let url = `/web/projects/${projectId}/green/construction/summaryEvaluates/${summaryId}/downloadWord`; const data = await this.factory.gssApi.exportFile(url); return data; } // 查询单位工程评价详情 async loadSummaryEvaluatesDetail(projectId: string, summaryId: string): Promise { let url = `/web/projects/${projectId}/green/construction/summaryEvaluates/${summaryId}/search`; const data = await this.factory.gssApi.get(url); return data; } // 阶段评价汇总表---查询接口 async getPhaseEvaluationDataList(projectId: string, filter?: string): Promise { let url = `/web/projects/${projectId}/green/construction/phaseEvaluates/search`; const data = await this.factory.gssApi.get(url, { filter }); return data; } // 阶段评价汇总表---根据id查询施工阶段详细信息 async getPhaseEvaluationDetails(projectId: string, batchId: string): Promise { let url = `/web/projects/${projectId}/green/construction/phaseEvaluates/${batchId}/search`; const data = await this.factory.gssApi.get(url); return data; } // 阶段评价汇总表---施工阶段评价下载 exportPhaseEvaluationDetails(projectId: string, batchId: string) { this.factory.gssApi.exportFile(`/web/projects/${projectId}/green/construction/phaseEvaluates/${batchId}/downloadWord`); } // 获取单位工程的阶段评分---带优良百分比--自查批次统计 async getSelfCheckBatchStatisticsCharts(projectId: string, unitProjectId: string): Promise { let url = `/web/projects/${projectId}/green/construction/phaseEvaluates/phaseStat`; const data = await this.factory.gssApi.get(url, { unitProjectId }); return data; } // 单位工程施工阶段批次列表--自查批次统计 ---列表 async getSelfCheckBatchStatisticsTable(projectId: string, unitProjectId: string, phase: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/${unitProjectId}/batchList`; const data = await this.factory.gssApi.get(url, { phase }); return data; } // 单位工程施工阶段批次列表--自查批次统计 ---列表 async getBatchEvaluationScoreTrendCharts(projectId: string, unitProjectId: string, phase: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/${unitProjectId}/batchScore`; const data = await this.factory.gssApi.get(url, { phase }); return data; } // 获取单位工程的阶段评分 async getUnitProjectPhaseScore(projectId: string, unitProjectId: string): Promise { let url = `/web/projects/${projectId}/green/construction/phaseEvaluates/phaseScore?unitProjectId=${unitProjectId}`; const data = await this.factory.gssApi.get(url); return data; } // 获取单位工程评分列表 async getUnitProjectScoreList(projectId: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/unitProjectScore`; const data = await this.factory.gssApi.get(url); return data; } // 单位工程下拉选择列表 async getUnitProjectSelectList(projectId: string): Promise { let url = `/web/projects/${projectId}/green/construction/unit/project/defaultSelectUnitProjectList`; const data = await this.factory.gssApi.get(url); return data; } // 获取措施列表 async getMeasuresList(projectId: string, bizType: string): Promise { let url = `/web/projects/${projectId}/constructionMethods/${bizType}/list`; const data = await this.factory.gssApi.get(url); return data; } // 添加节材节地目标对比数据 async postMaterialOrLandSavingData(projectId: string, bizType: string, dataArr: IMaterialOrLandSavingList[]): Promise { let url = `/web/projects/${projectId}/constructionReduceResults/${bizType}/batchAddOrUpdate`; const data = await this.factory.gssApi.post(url, dataArr); return data; } // 查询节材节地目标对比数据列表 async getMaterialOrLandSavingList(projectId: string, bizType: string): Promise { let url = `/web/projects/${projectId}/constructionReduceResults/${bizType}/list`; const data = await this.factory.gssApi.get(url); return data; } // 通过业务类型(reduce_material reduce_ground) 获取措施列表 async loadMeasureListByBizType(projectId: string, bizType: string): Promise { const data = await this.factory.gssApi.get( `/web/projects/${projectId}/constructionMethods/${bizType}/list` ); return data; } // 通过业务类型(reduce_material reduce_ground) 增加措施 async addMeasureItemByBizType(projectId: string, bizType: string, measureItem: IMeasureItem): Promise { const data = await this.factory.gssApi.post( `/web/projects/${projectId}/constructionMethods/${bizType}/add`, measureItem ); return data; } // 通过业务类型(reduce_material reduce_ground) 删除措施 async deleteMeasureItemByBizType(projectId: string, bizType: string, id: string): Promise { const data = await this.factory.gssApi.delete( `/web/projects/${projectId}/constructionMethods/${bizType}/delete/${id}` ) return data; } // 通过业务类型(reduce_material reduce_ground) 更新措施 async updateMeasureItemByBizType(projectId: string, bizType: string, id: string, measureItem: IMeasureItem): Promise { const data = await this.factory.gssApi.put( `/web/projects/${projectId}/constructionMethods/${bizType}/update/${id}`, measureItem ) return data; } // 通过业务类型(reduce_material reduce_ground) 获取系统默认措施列表 async loadDefaultMeasureListByBizType(projectId: string, bizType: string): Promise { const data = await this.factory.gssApi.get( `/web/projects/${projectId}/constructionMethods/${bizType}/defaultList` ); return data; } }