From 21654ab05a741078fea1fdf3c4d8c2d729e8f979 Mon Sep 17 00:00:00 2001 From: Li Jun <buli@deloitte.com.cn> Date: 星期一, 11 四月 2022 20:09:48 +0800 Subject: [PATCH] FixCloneButtonIssue --- force-app/main/default/classes/RepairBeforeInsertHandler.cls | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/force-app/main/default/classes/RepairBeforeInsertHandler.cls b/force-app/main/default/classes/RepairBeforeInsertHandler.cls index ecacee2..9aebb39 100644 --- a/force-app/main/default/classes/RepairBeforeInsertHandler.cls +++ b/force-app/main/default/classes/RepairBeforeInsertHandler.cls @@ -91,12 +91,15 @@ } if(falg && provinceList != null && cityList != null && provinceList.size() > 0 && cityList.size() > 0){ String addressSQl = 'SELECT ID,Customer__c,Customer_Name__c,Contacts__c,Contacts_Name__c,Telephone__c,Province__c,Province_Name__c,City__c,City_Name__c,Detailed_Address__c,ZipCode__c' + + ',Contacts__r.LastName_Encrypted__c,ZipCode_Encrypted__c,Detailed_Address_Encrypted__c,Telephone_Encrypted__c' // PI鏀归�� By Bright 20220407 + ' from Address__c ' + ' where Address_Classification__c = \'鍔炰簨澶刓' and Province_Name__c in :provinceList and City_Name__c in :cityList ' + ' order by Using_Datetime__c desc NULLS LAST '; - + system.debug('addressSQl='+addressSQl); List<Address__c> addressList = Database.query(addressSQl); + if(addressList != null && addressList.size() > 0){ + system.debug(addressList[0]); for (Repair__c nObj : newList) { if(nObj.Hospital__c != null && nObj.address_Contacts__c == null && nObj.address_Telephone__c == null && nObj.address_Contacts_Name__c == null && nObj.address_City__c == null && nObj.Detailed_Address__c == null){ //鐢变簬涓轰簡鍑忓皯select ,鎵�浠ヨ幏鍙栨垜浠厤缃ソ鐨刴ap锛屾牴鎹繚鏈夎澶囦笂鍖婚櫌鐨� OCSM绠$悊鐪�(鏂囨湰) 鐨勫�硷紝鑾峰彇瀵瑰簲鐨勫湴鍧�涓婄殑鐪佸拰甯� @@ -122,11 +125,14 @@ if(provinceAndCity.equals(pAc)){ //鑱旂郴浜� String contactsName = ''; + String contactsNameEncrypt = '';// 20220407 PI鏀归�� By Bright if(!String.isBlank(addressList[0].Contacts__c)){ contactsName = addressList[0].Contacts_Name__c; + contactsNameEncrypt = addressList[0].Contacts__r.LastName_Encrypted__c;// 20220407 PI鏀归�� By Bright } //鐪�+甯� String address = addressList[0].Detailed_Address__c.trim(); + String addressEncrypt = addressList[0].Detailed_Address_Encrypted__c; String cityName = addressList[0].City_Name__c.trim(); String ProvinceCity = addressList[0].Province_Name__c.trim()+cityName; //闃叉璇︾粏鍦板潃閲岄潰甯︾潃鐪佷唤鍜屽競 @@ -139,11 +145,17 @@ ContactPerson = addressList[0].Customer_Name__c; } nObj.address_Contacts__c=contactsName; + nObj.address_Contacts_Encrypt__c=contactsNameEncrypt;// 20220407 PI鏀归�� By Bright nObj.address_ZipCode__c = addressList[0].ZipCode__c; + nObj.address_ZipCode_Encrypt__c = addressList[0].ZipCode_Encrypted__c;// 20220407 PI鏀归�� By Bright nObj.address_City__c = cityName; nObj.address_Contacts_Name__c = ContactPerson; nObj.address_Telephone__c=addressList[0].Telephone__c; + nObj.address_Telephone_Encrypt__c=addressList[0].Telephone_Encrypted__c;// 20220407 PI鏀归�� By Bright nObj.Detailed_Address__c=address; + nObj.Detailed_Address_Encrypt__c=addressEncrypt;// 20220407 PI鏀归�� By Bright + nObj.Encrypt_Update_Flag__c=true;// 20220411 PI鏀归�� By Bright + system.debug('nObj assign and Encrypt_Update_Flag__c set true'); } } } -- Gitblit v1.9.1