| | |
| | | Account.PlatformCode__c, |
| | | Account.Management_Code__c, |
| | | Account.parent.Department_Class_Label__c, |
| | | Name, |
| | | Name,LastName_Encrypted__c, |
| | | Account.Parent_Management_Code__c, |
| | | Account.Parent_PlatformCode__c, |
| | | CManageCode__c, |
| | |
| | | for (Contact ct: peopleList) { |
| | | if (string.isnotblank(ct.Account.parent.Name)) { |
| | | Map < String, Contact > snameMap = new Map < String, Contact > (); |
| | | string Name = ct.Name.replaceAll(' ',''); |
| | | string namekey = ct.Account.Name + ' ' + Name; |
| | | string namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c; |
| | | // snameMap.put(namekey,ct); |
| | | if (nameMap.containsKey(ct.Account.parent.Name)) { |
| | | snameMap = nameMap.get(ct.Account.parent.Name); |
| | | } |
| | | snameMap.put(namekey, ct); |
| | | snameMap.put(ct.Name, ct); |
| | | snameMap.put(ct.LastName_Encrypted__c, ct); |
| | | nameMap.put(ct.Account.parent.Name, snameMap); |
| | | system.debug('snameMap'+snameMap); |
| | | } |
| | | peopleMap.put(ct.CManageCode__c, ct); |
| | | System.debug('peopleMap'+peopleMap); |
| | |
| | | } else { //人员管理编码不存在 |
| | | //搜索人名/且在当前战略科室科室下 |
| | | System.debug('人员管理编码不存在'); |
| | | string namekey = gedata.Name; |
| | | string namekey = gedata.NameEncrypted; |
| | | system.debug('DepartmentClasskey = '+DepartmentClasskey); |
| | | system.debug('nameMap22222222 '+nameMap); |
| | | if (nameMap.containskey(DepartmentClasskey)) { // 6 完成 更新操作 |
| | | Map < String, Contact > sMap = nameMap.get(DepartmentClasskey); |
| | | System.debug('sMap'+sMap); |
| | | System.debug('sMap.containsKey(namekey)'+sMap.containsKey(namekey)); |
| | | if (sMap.containsKey(namekey)) { |
| | | system.debug('Id赋值'+sMap); |
| | | ct.id = sMap.get(namekey).id; |
| | |
| | | } |
| | | } else { //人员管理编码不存在 |
| | | system.debug('人员管理编码不存在'); |
| | | string namekey = gedata.DepartmentName+ ' ' + gedata.Name; |
| | | string namekey = gedata.DepartmentName+ ' ' + gedata.NameEncrypted; |
| | | //string namekey = gedata.AccountName + ' ' + gedata.DepartmentName + ' ' + gedata.DepartmentClass + ' ' + gedata.Name; |
| | | system.debug('DepartmentClasskey'+DepartmentClasskey); |
| | | system.debug('351nameMap '+nameMap); |
| | |
| | | System.debug('人员管理编码不存在的情况下战略科室存在'); |
| | | system.debug('战略科室存在' + nameMap.get(DepartmentClasskey)); |
| | | Map < String, Contact > sMap = nameMap.get(DepartmentClasskey); |
| | | system.debug('namekey'+namekey); |
| | | system.debug('sMap.containsKey(namekey)'+sMap.containsKey(namekey)); |
| | | if (sMap.containsKey(namekey)) { //查找存在 8 完成 |
| | | system.debug('8逻辑'); |
| | | system.debug('该联系人存在'); |
| | |
| | | // if(sMap.containsKey(gedata.Name)){ |
| | | // ct.Id = sMap.get(gedata.Name).Id; |
| | | // } |
| | | }else if(sMap.containsKey(gedata.Name)){ |
| | | }else if(sMap.containsKey(gedata.NameEncrypted)){ |
| | | system.debug('1234567890'); |
| | | ct.Id = sMap.get(gedata.Name).Id; |
| | | ct.Id = sMap.get(gedata.NameEncrypted).Id; |
| | | //upsertAccountList.add(dpt); |
| | | } |
| | | system.debug('contactMap ' + contactMap); |
| | | System.debug('9逻辑'); |
| | | contactMap.put(Gedata.DepartmentManagementCode2, ct); |
| | | system.debug('contactMap ' + contactMap); |
| | | //upsertContactList.add(ct); |
| | | } |
| | | system.debug('创建联系人和科室'); |
| | | dpt.Department_Name__c = gedata.DepartmentName; |
| | |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | system.debug('upsertAccountList ' + upsertAccountList); |
| | | upsert upsertAccountList; |
| | | system.debug('SFDCCodeList'+SFDCCodeList); |
| | | system.debug('SFDCCodeList'+ManagementList); |
| | | List < Account > List1 = [select Id,RecordTypeId,Is_Active__c,PlatformCode__c,OCM_man_province_HP__c,OwnerId from Account where PlatformCode__c In: SFDCCodeList OR PlatformCode__c IN: ManagementList];//客户所有人修改11.18 11.35 未完成 |
| | | system.debug('List1'+List1); |
| | | List<Account> updateHPList = new List<Account>(); |
| | | for (Account ac: List1) { |
| | | Contact c = new contact(); |
| | | system.debug('ac.PlatformCode__c'+ac.PlatformCode__c); |
| | | system.debug('ContactMap'+ContactMap); |
| | | system.debug('ContactMap.containsKey(ac.PlatformCode__c)'+ContactMap.containsKey(ac.PlatformCode__c)); |
| | | if(ContactMap.containsKey(ac.PlatformCode__c)){ |
| | | c = contactMap.get(ac.PlatformCode__c); |
| | | if(string.isblank(c.Id)|| c.AccountId != ac.Id){ |
| | |
| | | } |
| | | //补充学会部分 end |
| | | } |
| | | } |