| | |
| | | |
| | | List<PCLLostProduct__c> lcrList=[select id,PCLLostBrand__r.Lost_cancel_report__r.of_lost_system_processor__c, |
| | | PCLLostBrand__r.Lost_Reason_Sub__c,PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c, |
| | | PCLLostBrand__r.Lost_cancel_report__r.TotalAmountLost__c, //20230215 lt DB202302247719 |
| | | PCLLostBrand__r.Lost_cancel_report__r.LostType__c,PCLLostBrand__r.Lost_By_Company__c, |
| | | PCLLostBrand__r.Lost_By_Company_Mannual__c,PCLLostBrand__r.LostPrice__c,LostProduct__r.Name, |
| | | PCLLostBrand__r.Lost_reason_main__c,PCLLostBrand__r.Agency__r.Name,PCLLostBrand__r.AgencyMannual__c, |
| | |
| | | Opportunity opp=new Opportunity(); |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | opp.RivalHostsNumber__c = 0; |
| | | System.debug('lt123初始失单主机数'+ opp.RivalHostsNumber__c); |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | opp.Id=arrMap.get(lcro).Opportunity__c; opp.PCLLostBrands__c=''; opp.Agencies__c=''; //Id ,品牌,经销商 |
| | | // for产品 |
| | | for (PCLLostProduct__c lcr : lcrList) { |
| | | System.debug('lt123主机111'+ lcr.ProductClass__c); |
| | | if (opp.Id==lcr.Opportunity__c) { |
| | | |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | System.debug('lt123主机'+ lcr.ProductClass__c); |
| | | if(lcr.ProductClass__c == '主机'){ |
| | | opp.RivalHostsNumber__c += lcr.Quantity__c; |
| | | System.debug('lt123累加失单主机数'+ opp.RivalHostsNumber__c); |
| | | }else{ |
| | | opp.RivalHostsNumber__c += 0; |
| | | System.debug('lt123不变失单主机数'+ opp.RivalHostsNumber__c); |
| | | } |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | |
| | | // } |
| | | // } |
| | | //失单总金额 |
| | | opp.LostPrices__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c; |
| | | //opp.LostPrices__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c;//20230215 lt DB202302247719 注释 |
| | | // opp.LostPrices__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.TotalAmountLost__c; //20230215 lt DB202302247719 |
| | | opp.of_lost_system_processor__c=lcr.PCLLostBrand__r.Lost_cancel_report__r.of_lost_system_processor__c; |
| | | } |
| | | } |
| | | //20230215 lt DB202302247719 start |
| | | if(arrMap.get(lcro).TotalAmountLost__c != null){ |
| | | if(opp.LostPrices__c == null){ |
| | | opp.LostPrices__c = 0; |
| | | } |
| | | opp.LostPrices__c+=arrMap.get(lcro).TotalAmountLost__c; |
| | | } |
| | | //20230215 lt DB202302247719 end |
| | | |
| | | // 20221202 ljh DB202211594688 start |
| | | System.debug('zheli00:'+oppIdPZSet+'~'+opp.Id); |
| | | if(oppIdPZSet.contains(opp.Id)){ |