import { ApiClientFactory } from '../core/api.client.factory'; import { Project } from '../model/project.model'; import { CloudtProject } from '../model/cloudt/project'; import { IMaterielGeneralSituation, IMaterielDeviationSupply, IMaterielSituationAnalysis, IMaterielRecentDevelopments, IGeneralTableList, ISupplyTableList, IReceiveProviderNearlyYearNegativeRank, IReceiveProviderNearlyYearKLRank, IRankingListItem, MaterialProportion, NegativeMonthTrend, ReceiveKlQuantity, DeviationDistribution, MaterialType, ReceiveMaterialYoyAndMomTrend, YoyAndMomTrendMaterialTag } from '../model/materiel.model'; export class MaterielService { constructor(private factory: ApiClientFactory) {} async loadMaterielGeneralSituation(projectId: string, tenantId: string): Promise { const result = await this.factory.gssApi.get( `/web/projects/${projectId}/material/overview?tenantId=${tenantId}` ); return result; } async loadMaterielDeviationSupply(projectId: string, tenantId: string, top: number): Promise { const result = await this.factory.gssApi.get( `/web/projects/${projectId}/material/supplierDeviation/overview?top=${top}` ); return result; } async loadMaterielSituationAnalysis(projectId: string, tenantId: string): Promise { const result = await this.factory.gssApi.get( `/web/projects/${projectId}/material/analysis?tenantId=${tenantId}` ); return result; } async loadMaterielRecentDevelopments(projectId: string, tenantId: string, limit: number): Promise { const result = await this.factory.gssApi.get( `/web/projects/${projectId}/material/recentNews?tenantId=${tenantId}&limit=${limit}` ); return result; } async loadGeneralTableList(projectId: string, tenantId: string, timeFilter: string, materialFilter: number, pageIndex: number,pageSize: number): Promise { const result = await this.factory.gssApi.get( `/web/projects/${projectId}/material/details?tenantId=${tenantId}&timeFilter=${timeFilter}&materialFilter=${materialFilter}&pageIndex=${pageIndex}&pageSize=${pageSize}` ); return result; } async loadSupplyTableList(projectId: string, tenantId: string, timeFilter: string, pageIndex: number,pageSize: number): Promise { const result = await this.factory.gssApi.get( `/web/projects/${projectId}/material/supplierDeviation/details?tenantId=${tenantId}&timeFilter=${timeFilter}&pageIndex=${pageIndex}&pageSize=${pageSize}` ); return result; } async loadReceiveProviderNearlyYearNegativeRank(projectId: string, month: any, type: string): Promise { const url = `/projects/${projectId}/materials/receiveProvider/getReceiveProviderNearlyYearNegativeRank`; const result = await this.factory.gssApi.get(url , { month, type }); return result; } async loadReceiveProviderNearlyYearKLRank(projectId: string, month: any, type: string): Promise { const url = `/projects/${projectId}/materials/receiveProvider/getReceiveProviderNearlyYearKLRank`; const result = await this.factory.gssApi.get(url , { month, type }); return result; } // 英雄榜月汇总 async loadHeroRankingListByDate(projectId: string, month: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/operatorBill/getOperatorNegativeCountMonthRank?month=${month}` ); return result; } // 英雄榜年汇总 async loadHeroRankingListByYear(projectId: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/operatorBill/getOperatorNegativeCountYearRank` ); return result; } // 英雄榜累计汇总 async loadHeroRankingListByAccumulativeTotal(projectId: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/operatorBill/getOperatorNegativeCountCumulativeRank` ); return result; } // 劳模榜月汇总 async loadModelLaborRankingListByDate(projectId: string, month: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/operatorBill/getOperatorBillCountMonthRank?month=${month}` ); return result; } // 劳模榜年汇总 async loadModelLaborRankingListByYear(projectId: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/operatorBill/getOperatorBillCountYearRank` ); return result; } // 劳模榜累计汇总 async loadModelLaborRankingListByAccumulativeTotal(projectId: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/operatorBill/getOperatorBillCountCumulativeRank` ) return result; } // 本年主要材料占比 async loadMaterialProportion(projectId: string, year: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/receiveMaterial/receiveMaterialProportionYear?year=${year}` ); return result; } // 供货偏差情况分析 async loadReceiveDeviation(projectId: string, year: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/receiveMaterial/getReceiveDeviationDistribution?year=${year}` ); return result; } // 近一年综合超负差情况走势 async loadReceiveNegative(projectId: string, dateStart: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/receiveMaterial/receiveNegativeMonthTrend?dateStart=${dateStart}` ); return result; } // 近一年材料扣量情况走势 async loadReceiveKlQuantity(projectId: string, materialTag: string, begin: string, end: string): Promise { const result = await this.factory.gssApi.post( `/projects/${projectId}/materials/receiveMaterial/getReceiveKlQuantityTrend`, { materialTag, begin, end } ); return result; } // 获取材料类型 async loadMaterialType(projectId: string, begin: string, end: string): Promise { const result = await this.factory.gssApi.post( `/projects/${projectId}/materials/receiveMaterial/getKlMaterialTag`, { begin, end } ); return result; } // 主要材料同环比走势 async loadReceiveMaterialYoyAndMomTrend(projectId: string, materialTag: string, begin: string, end: string): Promise { const result = await this.factory.gssApi.post( `/projects/${projectId}/materials/receiveMaterial/receiveMaterialYoyAndMomTrend`, { materialTag, begin, end } ); return result; } // 主要材料同环比下拉框 async LoadYoyAndMomTrendMaterialTag(projectId: string, year: string): Promise { const result = await this.factory.gssApi.get( `/projects/${projectId}/materials/receiveMaterial/getYoyAndMomTrendMaterialTag`, { year } ); return result; } }