| | |
| | | return repair; |
| | | } |
| | | //add wangweipeng 2021/12/09 end |
| | | //先款后修-修理增加先款标识 thh 20220318 start |
| | | //先款后修-修理增加先款标识 thh 20220322 start |
| | | public static void AdvancePaymentFlagUpsert(List<Repair__c> newList, Map<Id, Repair__c> newMap, List<Repair__c> oldList, Map<Id, Repair__c> oldMap) { |
| | | List<String> RepairQuotationIdList = new List<String>(); |
| | | List<Repair__c> NoRepairQuotationList = new List<Repair__c>(); |
| | | List<Repair_Quotation__c> RepairQuotationList = new List<Repair_Quotation__c>(); |
| | | List<String> DealerIdList = new List<String>(); |
| | | List<Account> DealerList = new List<Account>(); |
| | | List<Repair__c> updateRepairList = new List<Repair__c>(); |
| | | System.debug('newList1:' + newList); |
| | | for(Repair__c rep : newList){ |
| | | Repair__c oldRep = oldMap.get(rep.Id); |
| | | if(rep.Repair_Quotation_Id__c != null){ |
| | | RepairQuotationIdList.add(rep.Repair_Quotation_Id__c); |
| | | }else{ |
| | |
| | | for(Repair__c rep : newList){ |
| | | if(rq.Id == rep.Repair_Quotation_Id__c){ |
| | | rep.Advance_Payment_Flag__c = rq.Is_RecognitionModel__c; |
| | | updateRepairList.add(rep); |
| | | } |
| | | } |
| | | } |
| | |
| | | for(Repair__c rep : newList){ |
| | | if(rep.Dealer__c == dealer.Id){ |
| | | rep.Advance_Payment_Flag__c = dealer.FirstParagraphEnd__c; |
| | | updateRepairList.add(rep); |
| | | } |
| | | } |
| | | } |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | if(updateRepairList.size() > 0){ |
| | | update updateRepairList; |
| | | } |
| | | } catch (System.Exception e) { |
| | | Database.rollback(sp); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, e.getMessage())); |
| | | } |
| | | } |
| | | //先款后修-修理增加先款标识 thh 20220318 end |
| | | //先款后修-修理增加先款标识 thh 20220322 end |
| | | |
| | | public static void CheckUpdate(List<Repair__c> oldList, Map<Id, Repair__c> newMap) { |
| | | System.debug('===========> start'); |