| | |
| | | public class Opponent_Bid_InformationHandler extends Oly_TriggerHandler { |
| | | |
| | | private Map<Id, Opponent_Bid_Information__c> newMap; |
| | | /** |
| | | private Map<Id, Opponent_Bid_Information__c> newMap; |
| | | private Map<Id, Opponent_Bid_Information__c> oldMap; |
| | | private List<Opponent_Bid_Information__c> newList; |
| | | private List<Opponent_Bid_Information__c> oldList; |
| | |
| | | updateOpponentInfo(); |
| | | } |
| | | private void updateOpponentInfo() { |
| | | List<Opportunity> oppList = new List<Opportunity>(); |
| | | List<Opportunity> oppList = new List<Opportunity>(); |
| | | // 因为没法跨表,所以进行select,如果使用那些字段,需要手动添加 |
| | | List<Opponent_Bid_Information__c> temOBIList = |
| | | [select id,Opportunity__c,Report_Status__c, |
| | |
| | | CompetitorProduct4__r.id, CompetitorProduct4__r.Name |
| | | from Opponent_Bid_Information__c |
| | | where id in: newList]; |
| | | for (Opponent_Bid_Information__c n : temOBIList) { |
| | | for (Opponent_Bid_Information__c n : temOBIList) { |
| | | if (n.Report_Status__c == '批准' ) { |
| | | Opportunity opp = new Opportunity(); |
| | | Opportunity opp = new Opportunity(); |
| | | opp.id = n.Opportunity__c; |
| | | |
| | | opp.Lost_By_Company_part__c = n.Lost_By_Company__c; |
| | | opp.Lost_reason_main_part__c = n.Lost_reason_main__c; |
| | | opp.of_lost_system_processor_part__c = n.of_lost_system_processor__c; |
| | | opp.Lost_By_Company_part__c = n.Lost_By_Company__c; |
| | | opp.Lost_reason_main_part__c = n.Lost_reason_main__c; |
| | | opp.of_lost_system_processor_part__c = n.of_lost_system_processor__c; |
| | | if(n.Lost_Reason_Sub__c!=null){ |
| | | opp.Lost_Reason_Sub_part__c = n.Lost_Reason_Sub__c+';'; |
| | | opp.Lost_Reason_Sub_part__c = n.Lost_Reason_Sub__c+';'; |
| | | }else{ |
| | | opp.Lost_Reason_Sub_part__c = n.Lost_Reason_Sub__c; |
| | | } |
| | | opp.Lost_By_Product_part__c = n.Lost_By_Product__c; |
| | | opp.Lost_By_Product_part__c = n.Lost_By_Product__c; |
| | | |
| | | if (n.CompetitorProduct1__r.id == '01t10000000Tqam') { |
| | | opp.CompetitorProduct1_part__c = n.Lost_By_Product__c; |
| | |
| | | opp.CompetitorProduct4_part__c = n.CompetitorProduct4__r.Name; |
| | | } |
| | | oppList.add(opp); |
| | | |
| | | } |
| | | } |
| | | if (oppList.size() > 0) update oppList; |
| | | } |
| | | }**/ |
| | | |
| | | } |