buli
2022-04-26 5835379ec30b1667c4e522db9d294c9b7bb8633a
force-app/main/default/classes/OrderTriggerHandler.cls
@@ -107,8 +107,8 @@
                    
                    system.debug('2222222'+getModelQuantityMap);
                    String accountDealerErrorMessage = RadiationUtil.updateCertificationDetails(oliList[0].Opportunity.DealerId__c, null, getModelQuantityMap, false);
                    String olympusDealerErrorMessage = RadiationUtil.updateCertificationDetails(olympusAccountId, null, getModelQuantityMap, false) == '' ? '' : '奥林巴斯可销售数量不足';
                    //result = accountDealerErrorMessage + (olympusDealerErrorMessage == '' ? '' : '奥林巴斯可销售数量不足') ;
                    String olympusDealerErrorMessage = RadiationUtil.updateCertificationDetails(olympusAccountId, null, getModelQuantityMap, false) == '' ? '' : '仪景通可销售数量不足';
                    //result = accountDealerErrorMessage + (olympusDealerErrorMessage == '' ? '' : '仪景通可销售数量不足') ;
                    Boolean temp = accountDealerErrorMessage.startsWith('你不能');
                    String strOly = LicenseCheckUtil.LicenseCheckOly();
                    if(temp){
@@ -360,6 +360,11 @@
                newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c;
                newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c;
                newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c;
                // PIPL Update 20220420 By Chen Yanan Start
                newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c;
                newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c;
                newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c;
                // PIPL Update 20220420 By Chen Yanan End
                newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c;
                newOrd.SpecialWarranty_D__c = newOrd.SpecialWarranty__c;
                newOrd.DealerProfit_D__c = newOrd.DealerProfit__c;
@@ -425,7 +430,7 @@
    }
    public static void setPriceBook(List<Order> newList, Map<Id, Order> newMap, List<Order> oldList, Map<Id, Order> oldMap) {
        List<String> oppidList = new List<String>();
        for (Order o : newList) {
            oppidList.add(o.OpportunityId);
@@ -1316,12 +1321,21 @@
            }
            if (newOrd.SpecialDeliveryContact__c != oldOrd.SpecialDeliveryContact__c) {
                newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c;
                // PIPL Update 20220420 By Chen Yanan Start
                newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c;
                // PIPL Update 20220420 By Chen Yanan End
            }
            if (newOrd.SpecialDeliveryPhone__c != oldOrd.SpecialDeliveryPhone__c) {
                newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c;
                // PIPL Update 20220420 By Chen Yanan Start
                newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c;
                // PIPL Update 20220420 By Chen Yanan End
            }
            if (newOrd.SpecialDeliveryAddress__c != oldOrd.SpecialDeliveryAddress__c) {
                newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c;
                // PIPL Update 20220420 By Chen Yanan Start
                newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c;
                // PIPL Update 20220420 By Chen Yanan End
            }
            if (newOrd.SpecialParkage__c != oldOrd.SpecialParkage__c) {
                newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c;
@@ -1637,6 +1651,11 @@
                    newOrd.SpecialDeliveryContact__c = newOrd.SpecialDeliveryContact_D__c;
                    newOrd.SpecialDeliveryPhone__c = newOrd.SpecialDeliveryPhone_D__c;
                    newOrd.SpecialDeliveryAddress__c = newOrd.SpecialDeliveryAddress_D__c;
                    // PIPL Update 20220420 By Chen Yanan Start
                    newOrd.SpecialDeliveryContact_Encrypted__c = newOrd.SpecialDeliveryContact_D_Encrypted__c;
                    newOrd.SpecialDeliveryPhone_Encrypted__c = newOrd.SpecialDeliveryPhone_D_Encrypted__c;
                    newOrd.SpecialDeliveryAddress_Encrypted__c = newOrd.SpecialDeliveryAddress_D_Encrypted__c;
                    // PIPL Update 20220420 By Chen Yanan End
                    newOrd.SpecialParkage__c = newOrd.SpecialParkage_D__c;
                    newOrd.SpecialWarranty__c = newOrd.SpecialWarranty_D__c;
                    newOrd.DealerProfit__c = newOrd.DealerProfit_D__c;
@@ -1765,6 +1784,11 @@
                    newOrd.SpecialDeliveryContact_D__c = newOrd.SpecialDeliveryContact__c;
                    newOrd.SpecialDeliveryPhone_D__c = newOrd.SpecialDeliveryPhone__c;
                    newOrd.SpecialDeliveryAddress_D__c = newOrd.SpecialDeliveryAddress__c;
                    // PIPL Update 20220420 By Chen Yanan Start
                    newOrd.SpecialDeliveryContact_D_Encrypted__c = newOrd.SpecialDeliveryContact_Encrypted__c;
                    newOrd.SpecialDeliveryPhone_D_Encrypted__c = newOrd.SpecialDeliveryPhone_Encrypted__c;
                    newOrd.SpecialDeliveryAddress_D_Encrypted__c = newOrd.SpecialDeliveryAddress_Encrypted__c;
                    // PIPL Update 20220420 By Chen Yanan End
                    newOrd.SpecialParkage_D__c = newOrd.SpecialParkage__c;
                    newOrd.SpecialWarranty_D__c = newOrd.SpecialWarranty__c;
                    newOrd.DealerProfit_D__c = newOrd.DealerProfit__c;
@@ -1806,6 +1830,9 @@
                    newOrd.Contract_StatusD__c = newOrd.Contract_Status__c;
                    newOrd.ProductConfig_D__c = newOrd.ProductConfig__c;
                    // PIPL Update 20220420 By Chen Yanan Start
                    newOrd.SpecialDeliveryPhone_Encrypted__c = newOrd.SpecialDeliveryPhone_D_Encrypted__c;
                    // PIPL Update 20220420 By Chen Yanan End
                    if (newOrd.Upload_IsChanged__c == true) {
                        newOrd.Upload_IsChanged__c = false;
@@ -2824,6 +2851,8 @@
        for(OpportunityContactRole oppor:role_list){
            roleMap.put(oppor.OpportunityId,oppor.ContactId);
        }
        System.debug('oppidList: ' + oppidList);//Nancy 2022-04-25
        System.debug('role_list: ' + role_list);//Nancy 2022-04-25
        // 获取系统管理员Id
        String getUserId = System.label.SystemAdmin1_2_GPI;
        String errMessage = '客户名或最终用户与询价不一致!';
@@ -2832,7 +2861,13 @@
                System.debug(oppAccountMap.get(orOne.OpportunityId) != orOne.AccountId);
                System.debug( !roleMap.containsKey(orOne.OpportunityId));
                System.debug(orOne.EndUserD__c + '++'+ roleMap.get(orOne.OpportunityId));
                //zhj 2022-04-22 start
                System.debug('oppAccountMap.get(orOne.OpportunityId) = ' + oppAccountMap.get(orOne.OpportunityId));
                System.debug('orOne.AccountId = ' + orOne.AccountId);
                System.debug('roleMap.containsKey(orOne.OpportunityId) = ' + roleMap.containsKey(orOne.OpportunityId));
                System.debug('orOne.EndUserD__c = ' + orOne.EndUserD__c);
                System.debug('roleMap.get(orOne.OpportunityId) = ' + roleMap.get(orOne.OpportunityId));
                //zhj 2022-04-22 end
                if(oppAccountMap.get(orOne.OpportunityId) != orOne.AccountId || !roleMap.containsKey(orOne.OpportunityId) || orOne.EndUserD__c != roleMap.get(orOne.OpportunityId)){
                    // 获取用户Id
                    String userId = UserInfo.getUserId().subString(0,15);