| | |
| | | public Inquiry_form__c ifc{get; private set;} |
| | | public String contactDataId{get; set;} |
| | | public String layoutSectionsStr {get; set;} |
| | | public String isQueryContact{get; set;} |
| | | public String isDecryptContact {get; set;} |
| | | public NewAndEditLeadController(ApexPages.StandardController controller) { |
| | | isQueryContact = '0'; |
| | | isDecryptContact = '0'; |
| | | isNewMode = true; |
| | | Input_Required_Field_Msg = Label.Input_Required_Field_Msg; |
| | | PIPL_Name_Label = Label.PIPL_Name_Label; |
| | |
| | | System.debug('CF00N1000000962np_lkid'); |
| | | //产品咨询单过来的 |
| | | String InquiryFormId = ApexPages.currentPage().getParameters().get('CF00N1000000962np_lkid'); |
| | | ifc = [select Id,AWS_Data_Id__c,Contact_Name__c,Contact_Id__c,Hospital_Name__c,Hospital_ID__c,Department_Class__c,Department_ID__c,Opp_Name_Search__c,Opp_Name_Search_ID__c,Campaign__c, |
| | | ifc = [select Id,AWS_Data_Id__c,Contact_Name__c,Contact_Id__c,Hospital_Name__c,Hospital_ID__c,Department_Class__c, |
| | | Department_ID__c,Opp_Name_Search__c,Opp_Name_Search_ID__c,Campaign__c, |
| | | Campaign_ID__c,Name,Cancel_Reason__c,Phone__c,Email__c,Last_Name__c,LeadSource__c,Opportunity_Division__c,Request1__c, |
| | | Urgent__c from Inquiry_form__c where id = :InquiryFormId]; |
| | | Contact c = [select AWS_Data_Id__c from Contact where id = :ifc.Contact_Id__c]; |
| | | contactDataId = c.AWS_Data_Id__c; |
| | | System.debug('ifc = ' + ifc); |
| | | if(ifc.Contact_Id__c !=null && ifc.Contact_Id__c != ''){ |
| | | Contact c = [select AWS_Data_Id__c from Contact where id = :ifc.Contact_Id__c]; |
| | | contactDataId = c.AWS_Data_Id__c; |
| | | } |
| | | AWSDataIdInquiryForm = ifc.AWS_Data_Id__c; |
| | | System.debug('ifc = ' + ifc); |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | |
| | | sfIdToAWSIdMap.put(String.valueof(leadData.Contact_Name__r.Id).subString(0,15),leadData.Contact_Name__r.AWS_Data_Id__c); |
| | | } |
| | | contactsInfo = JSON.serialize(sfIdToAWSIdMap); |
| | | }else if(ApexPages.currentPage().getParameters().get('CF00N10000006ps6f_lkid') != null){ |
| | | //联系人过来的点击新建意向 |
| | | isQueryContact = '1'; |
| | | String contactId = ApexPages.currentPage().getParameters().get('CF00N10000006ps6f_lkid'); |
| | | Contact contactTemp = [select Id,RecordTypeId,AWS_Data_Id__c from Contact where id =:contactId]; |
| | | Map<String,String> sfIdToAWSIdMap = new Map<String,String>(); |
| | | if(contactTemp.Id != null){ |
| | | sfIdToAWSIdMap.put(String.valueof(contactTemp.Id).subString(0,15),contactTemp.AWS_Data_Id__c); |
| | | } |
| | | contactsInfo = JSON.serialize(sfIdToAWSIdMap); |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | }else{ |
| | | //新建 |
| | | //看链接中有无带过来的参数(客户人员) |
| | | Map<string,string> mso = ApexPages.currentPage().getParameters(); |
| | | for(String key : mso.keySet()){ |
| | | System.debug('key=' + key + ',value=' + mso.get(key)); |
| | | } |
| | | //联系人 |
| | | if(mso.containsKey('CF00N10000006ps6f_lkid')){ |
| | | isDecryptContact = '1'; |
| | | String contactId = mso.get('CF00N10000006ps6f_lkid'); |
| | | //查询AWS_Data_Id__c |
| | | Contact c = [select AWS_Data_Id__c from Contact where id=:contactId]; |
| | | if (c != null) { |
| | | contactDataId = c.AWS_Data_Id__c; |
| | | } |
| | | //查询战略科室分类 |
| | | List<Contact> cs = [select Account.Department_Class__c from Contact where id='0030l00000mldeG']; |
| | | if(cs.size()>0){ |
| | | controller.getRecord().put('Department_Class__c',cs[0].Account.Department_Class__c); |
| | | } |
| | | controller.getRecord().put('Contact_Name__c',mso.get('CF00N10000006ps6f_lkid')); |
| | | } |
| | | //医院名 |
| | | if(mso.containsKey('CF00N10000002CvC5_lkid')){ |
| | | controller.getRecord().put('Hospital_Name__c',mso.get('CF00N10000002CvC5_lkid')); |
| | | } |
| | | //战略科室CF00N10000006qNtt_lkid |
| | | // if(mso.containsKey('CF00N10000006qNtt_lkid ')){ |
| | | // controller.getRecord().put('Department_Class__c',mso.get('CF00N10000006qNtt_lkid ')); |
| | | // } |
| | | rtTypeId = ApexPages.currentPage().getParameters().get('RecordType'); |
| | | obj.put('OwnerId',UserInfo.getUserId()); |
| | | } |