| | |
| | | // String new_profileId = UserInfo.getProfileId().subString(0,15); |
| | | //calendarUtil.getMemberProfileID 这里用到的人员ID 和获取到的简档ID都是15位的 |
| | | String new_profileId = calendarUtil.getMemberProfileID(UserInfo.getUserId().subString(0,15)); |
| | | |
| | | |
| | | if (new_profileId.subString(0,15) == System.label.Market_Department || new_profileId.subString(0,15) == System.label.Market_Department1 || new_profileId.subString(0,15) == System.label.Service_Owner || |
| | | UserInfo.getUserType() == 'PowerPartner') { |
| | | newCon.IsNew__c = true; |
| | |
| | | if(new_profileId.subString(0,15) == '00e28000000YKLo'){ |
| | | newCon.IsNew__c = true; |
| | | } |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.MobilePhoneD_Encrypted__c = newCon.MobilePhone_Encrypted__c; |
| | | newCon.OtherPhoneD_Encrypted__c = newCon.OtherPhone_Encrypted__c; |
| | | newCon.FaxD_Encrypted__c = newCon.Fax_Encrypted__c; |
| | | newCon.EmailD_Encrypted__c = newCon.Email_Encrypted__c; |
| | | newCon.PhoneD_Encrypted__c = newCon.Phone_Encrypted__c; |
| | | newCon.TitleD_Encrypted__c = newCon.Title_Encrypted__c; |
| | | newCon.Address1D_Encrypted__c = newCon.Address1_Encrypted__c; |
| | | newCon.Address2D_Encrypted__c = newCon.Address2_Encrypted__c; |
| | | newCon.Address3D_Encrypted__c = newCon.Address3_Encrypted__c; |
| | | newCon.PostcodeD_Encrypted__c = newCon.Postcode_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | System.debug('setIsNew newCon: ' + newCon); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void updateForDealer(List<Contact> newList, Map<Id, Contact> newMap, List<Contact> oldList, Map<Id, Contact> oldMap) { |
| | |
| | | |
| | | if (newCon.MobilePhone != oldCon.MobilePhone) { |
| | | newCon.MobilePhoneD__c = newCon.MobilePhone; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('MobilePhoneD_Encrypted__c'); |
| | | newCon.MobilePhoneD_Encrypted__c = newCon.MobilePhone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.OtherPhone != oldCon.OtherPhone) { |
| | | newCon.OtherPhoneD__c = newCon.OtherPhone; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('OtherPhoneD_Encrypted__c'); |
| | | newCon.OtherPhoneD_Encrypted__c = newCon.OtherPhone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Fax != oldCon.Fax) { |
| | | newCon.FaxD__c = newCon.Fax; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('FaxD_Encrypted__c'); |
| | | newCon.FaxD_Encrypted__c = newCon.Fax_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Email != oldCon.Email) { |
| | | newCon.EmailD__c = newCon.Email; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('EmailD_Encrypted__c'); |
| | | newCon.EmailD_Encrypted__c = newCon.Email_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Phone != oldCon.Phone) { |
| | | newCon.PhoneD__c = newCon.Phone; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('PhoneD_Encrypted__c'); |
| | | newCon.PhoneD_Encrypted__c = newCon.Phone_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Title != oldCon.Title) { |
| | | newCon.TitleD__c = newCon.Title; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('TitleD_Encrypted__c'); |
| | | newCon.TitleD_Encrypted__c = newCon.Title_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Address1__c != oldCon.Address1__c) { |
| | | newCon.Address1D__c = newCon.Address1__c; |
| | | System.debug('Address1D_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.Address1D_Encrypted__c = newCon.Address1_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Address2__c != oldCon.Address2__c) { |
| | | newCon.Address2D__c = newCon.Address2__c; |
| | | System.debug('Address2D_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.Address2D_Encrypted__c = newCon.Address2_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Address3__c != oldCon.Address3__c) { |
| | | newCon.Address3D__c = newCon.Address3__c; |
| | | System.debug('Address3D_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.Address3D_Encrypted__c = newCon.Address3_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | if (newCon.Postcode__c != oldCon.Postcode__c) { |
| | | newCon.PostcodeD__c = newCon.Postcode__c; |
| | | System.debug('PostcodeD_Encrypted__c'); |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.PostcodeD_Encrypted__c = newCon.Postcode_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | |
| | | if (newCon.ContactStatus__c != oldCon.ContactStatus__c) { |
| | |
| | | if (newCon.CancelReason__c != oldCon.CancelReason__c) { |
| | | newCon.CancelReasonD__c = newCon.CancelReason__c; |
| | | } |
| | | System.debug('updateForDealer newCon: ' + newCon); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public static void dealerContactApproval(List<Contact> newList, Map<Id, Contact> newMap, List<Contact> oldList, Map<Id, Contact> oldMap) { |
| | |
| | | |
| | | newCon.ContactStatus__c = newCon.ContactStatusD__c; |
| | | newCon.CancelReason__c = newCon.CancelReasonD__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | newCon.MobilePhone_Encrypted__c = newCon.MobilePhoneD_Encrypted__c; |
| | | newCon.OtherPhone_Encrypted__c = newCon.OtherPhoneD_Encrypted__c; |
| | | newCon.Fax_Encrypted__c = newCon.FaxD_Encrypted__c; |
| | | newCon.Email_Encrypted__c = newCon.EmailD_Encrypted__c; |
| | | newCon.Phone_Encrypted__c = newCon.PhoneD_Encrypted__c; |
| | | newCon.Title_Encrypted__c = newCon.TitleD_Encrypted__c; |
| | | newCon.Address1_Encrypted__c = newCon.Address1D_Encrypted__c; |
| | | newCon.Address2_Encrypted__c = newCon.Address2D_Encrypted__c; |
| | | newCon.Address3_Encrypted__c = newCon.Address3D_Encrypted__c; |
| | | newCon.Postcode_Encrypted__c = newCon.PostcodeD_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } else if (newCon.StatusD__c != oldCon.StatusD__c) { |
| | | if (newCon.StatusD__c == 'Submit') { |
| | | //newCon.DealerSelectOwner__c = newCon.Account.DealerSelectOwner__c; |
| | |
| | | |
| | | newCon.ContactStatus__c = newCon.ContactStatusD__c; |
| | | newCon.CancelReason__c = newCon.CancelReasonD__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('Pass'); |
| | | newCon.MobilePhone_Encrypted__c = newCon.MobilePhoneD_Encrypted__c; |
| | | newCon.OtherPhone_Encrypted__c = newCon.OtherPhoneD_Encrypted__c; |
| | | newCon.Fax_Encrypted__c = newCon.FaxD_Encrypted__c; |
| | | newCon.Email_Encrypted__c = newCon.EmailD_Encrypted__c; |
| | | newCon.Phone_Encrypted__c = newCon.PhoneD_Encrypted__c; |
| | | newCon.Title_Encrypted__c = newCon.TitleD_Encrypted__c; |
| | | newCon.Address1_Encrypted__c = newCon.Address1D_Encrypted__c; |
| | | newCon.Address2_Encrypted__c = newCon.Address2D_Encrypted__c; |
| | | newCon.Address3_Encrypted__c = newCon.Address3D_Encrypted__c; |
| | | newCon.Postcode_Encrypted__c = newCon.PostcodeD_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | |
| | | // if (accsMap.containsKey(newCon.AccountId + '' + newCon.OwnerId) == true && newCon.IsNew__c == true) { |
| | | // AccountShare upd = new AccountShare( |
| | |
| | | |
| | | newCon.ContactStatusD__c = newCon.ContactStatus__c; |
| | | newCon.CancelReasonD__c = newCon.CancelReason__c; |
| | | // PIPL Update 20220420 By Chen Yanan Start |
| | | System.debug('Reject'); |
| | | newCon.MobilePhoneD_Encrypted__c = newCon.MobilePhone_Encrypted__c; |
| | | newCon.OtherPhoneD_Encrypted__c = newCon.OtherPhone_Encrypted__c; |
| | | newCon.FaxD_Encrypted__c = newCon.Fax_Encrypted__c; |
| | | newCon.EmailD_Encrypted__c = newCon.Email_Encrypted__c; |
| | | newCon.PhoneD_Encrypted__c = newCon.Phone_Encrypted__c; |
| | | newCon.TitleD_Encrypted__c = newCon.Title_Encrypted__c; |
| | | newCon.Address1D_Encrypted__c = newCon.Address1_Encrypted__c; |
| | | newCon.Address2D_Encrypted__c = newCon.Address2_Encrypted__c; |
| | | newCon.Address3D_Encrypted__c = newCon.Address3_Encrypted__c; |
| | | newCon.PostcodeD_Encrypted__c = newCon.Postcode_Encrypted__c; |
| | | // PIPL Update 20220420 By Chen Yanan End |
| | | } |
| | | System.debug('dealerContactApproval newCon: ' + newCon); |
| | | } |
| | | } |
| | | // 更新客户小组 |