涂煌豪
2022-03-22 8e39e511f1a272ee05b53ff68a985464a8c7ccf9
先款后修-修理上增加先款标识
2个文件已修改
17 ■■■■ 已修改文件
force-app/main/default/classes/RepairTrigger.cls 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/triggers/Repair.trigger 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/RepairTrigger.cls
@@ -696,15 +696,13 @@
        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){
            if(rep.Repair_Quotation_Id__c != null){
                RepairQuotationIdList.add(rep.Repair_Quotation_Id__c);
@@ -712,8 +710,6 @@
                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];
@@ -722,7 +718,6 @@
            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);
                }
            }
        }
@@ -739,15 +734,11 @@
            for(Repair__c rep : newList){
                if(rep.Dealer__c == dealer.Id){
                    rep.Advance_Payment_Flag__c = dealer.FirstParagraphEnd__c;
                    // updateRepairList.add(rep);
                }
            }
        }
        // if(updateRepairList.size() > 0){
        //     update updateRepairList;
        // }
    }
    //先款后修-修理增加先款标识 thh 20220318 end
    //先款后修-修理增加先款标识 thh 20220322 end
    public static void CheckUpdate(List<Repair__c> oldList, Map<Id, Repair__c> newMap) {
        System.debug('===========> start');
force-app/main/default/triggers/Repair.trigger
@@ -26,9 +26,9 @@
    // ここより、修理のサービスコントラクト項目を自動的に更新するロジック
    // ----------------------------------------------------------------------
    if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) {
        //先款后修-修理增加先款标识 thh 20220318 start
        //先款后修-修理增加先款标识 thh 20220322 start
        RepairTrigger.AdvancePaymentFlagUpsert(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap);
        //先款后修-修理增加先款标识 thh 20220318 end
        //先款后修-修理增加先款标识 thh 20220322 end
        // 納入機器IDを一意に格納する Setです。
        Set<ID> assetIds = new Set<Id>();