From 18177a0121022fed55c578471785e4c2c6b9691b Mon Sep 17 00:00:00 2001
From: 涂煌豪 <tuhuanghao@prec-tech.com>
Date: 星期一, 21 三月 2022 18:00:52 +0800
Subject: [PATCH] 修理触发器的修改

---
 force-app/main/default/classes/RepairTrigger.cls |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/force-app/main/default/classes/RepairTrigger.cls b/force-app/main/default/classes/RepairTrigger.cls
index 4d36d5f..14a9d14 100644
--- a/force-app/main/default/classes/RepairTrigger.cls
+++ b/force-app/main/default/classes/RepairTrigger.cls
@@ -706,13 +706,14 @@
         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{
                 NoRepairQuotationList.add(rep);
             }
         }
+        System.debug('RepairQuotationIdList1:' + RepairQuotationIdList);
+        System.debug('NoRepairQuotationList1:' + NoRepairQuotationList);
         //鍚屾湡涓殑淇悊淇悊鎶ヤ环鏈夊�兼椂锛岀湅鎶ヤ环涓婄殑鍏堟鏍囪瘑杩涜璧嬪��
         if(RepairQuotationIdList.size() > 0){
             RepairQuotationList = [select Id, Is_RecognitionModel__c from Repair_Quotation__c where Id IN :RepairQuotationIdList];
@@ -721,7 +722,7 @@
             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);
+                    // updateRepairList.add(rep);
                 }
             }
         }
@@ -738,19 +739,13 @@
             for(Repair__c rep : newList){
                 if(rep.Dealer__c == dealer.Id){
                     rep.Advance_Payment_Flag__c = dealer.FirstParagraphEnd__c;
-                    updateRepairList.add(rep);
+                    // 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()));
-        }
+        // if(updateRepairList.size() > 0){
+        //     update updateRepairList;
+        // }
     }
     //鍏堟鍚庝慨-淇悊澧炲姞鍏堟鏍囪瘑 thh 20220318 end
 

--
Gitblit v1.9.1