public class InquiryFormController {
|
@AuraEnabled
|
public static InitData init(String recordId){
|
InitData res = new initData();
|
try{
|
//add by Deloitte-王雪琴 2023/08/08(新增搜索,添加传值 Hospital_Name__r.Name,Contact_Name__r.Name,Contact_Name__r.AWS_Data_Id__c,Inquiry_Num__cHospital_Name__r) start
|
Inquiry_form__c report = [SELECT Id,Inquiry_Num__c,Hospital_Name__r.Name,Contact_Name__r.Name,Name,Service_Status__c,FSE_Owner__c,FSE_Owner_id__c,Status__c,Lead_link__c,Opp_Name_Search__c,Contact_Name__c,Contact_Id__c,Hospital_Name__c,Hospital_ID__c,Department_Class__c,Department_ID__c,Opp_Name_Search_ID__c,Campaign__c,Campaign_ID__c,Cancel_Reason__c,Product_Owner__c,Phone__c,Email__c,Last_Name__c,LeadSource__c,Opportunity_Division__c,Request1__c,Urgent__c,Family_Name__c FROM Inquiry_form__c WHERE Id = :recordId LIMIT 1];
|
res.Company = report.Hospital_Name__r.Name;
|
//res.awsDataId = report.Contact_Name__r.AWS_Data_Id__c; //deloitte-zhj 20231123 PIPL还原
|
res.InquiryNum = report.Inquiry_Num__c;
|
//res.InquiryAWSDataId = report.AWS_Data_Id__c; //deloitte-zhj 20231123 PIPL还原
|
//add by 王雪琴 2023/08/08(新增搜索Hospital_Name__r.Name 字段) end
|
res.Id = report.Id;
|
res.Name = report.Name;
|
res.ServiceStatus = report.Service_Status__c;
|
res.Status = report.Status__c;
|
res.profileId = UserInfo.getProfileId();
|
res.userId = UserInfo.getUserId();
|
res.LeadLink= report.Lead_link__c;
|
res.OppNameSearch= report.Opp_Name_Search__c;
|
//update by Deloitte-王雪琴 2023/08/08 start
|
res.ContactName= report.Contact_Name__r.Name;
|
res.ContactId = report.Contact_Name__c;
|
//update by Deloitte-王雪琴 2023/08/08 start
|
res.HospitalName = report.Hospital_Name__c;
|
res.HospitalID = report.Hospital_ID__c;
|
res.DepartmentClass= report.Department_Class__c;
|
res.DepartmentID = report.Department_ID__c;
|
res.OppNameSearchID= report.Opp_Name_Search_ID__c;
|
res.Campaign= report.Campaign__c;
|
res.CampaignID = report.Campaign_ID__c;
|
res.CancelReason= report.Cancel_Reason__c;
|
res.Phone = report.Phone__c;
|
res.Email= report.Email__c;
|
res.LastName = report.Last_Name__c;
|
res.LeadSource = report.LeadSource__c;
|
res.OpportunityDivision = report.Opportunity_Division__c;
|
res.Request1 = report.Request1__c;
|
res.Urgent = report.Urgent__c;
|
res.FSEOwner = report.FSE_Owner__c;
|
res.FSEOwnerId = report.FSE_Owner_id__c;
|
res.FamilyName = report.Family_Name__c;
|
res.JINGZHUOJISHU = getUserName(LightingButtonConstant.JINGZHUO_JISHU);
|
res.Standard = Schema.SObjectType.Lead.getRecordTypeInfosByDeveloperName().get('Standard').getRecordTypeId();
|
// res.staticResource = Json.serialize(PIHelper.getPIIntegrationInfo('Inquiry_form__c'));
|
// System.debug('res.staticResource = ' + Json.serialize(PIHelper.getPIIntegrationInfo('Inquiry_form__c')));
|
System.debug(LoggingLevel.INFO, '*** xu: ' + res);
|
}catch(Exception e){
|
System.debug(LoggingLevel.INFO, '*** exu: ' + e);
|
System.debug('error : ' + e.getMessage() + ' ' + e.getLineNumber());
|
}
|
return res;
|
}
|
//新建一项
|
@AuraEnabled
|
public static List<Inquiry_form__c> sqlResult (String id) {
|
try {
|
List<Inquiry_form__c> records = [SELECT id,Request_Detail__c FROM Inquiry_form__c WHERE id = :id];
|
System.debug(LoggingLevel.INFO, '*** xu1: ' + records);
|
return records;
|
} catch (Exception e) {
|
System.debug(LoggingLevel.INFO, '*** xu1111111: ' + e);
|
throw new AuraHandledException(e.getMessage());
|
}
|
}
|
@AuraEnabled
|
public static string getUserName(String name){
|
User user = null;
|
try {
|
user = [select Id from user where Name =:name];
|
} catch (Exception e) {
|
throw new AuraHandledException(e.getMessage());
|
}
|
return user.Id;
|
}
|
public class InitData{
|
@AuraEnabled
|
public String Id;
|
@AuraEnabled
|
public String ServiceStatus;
|
@AuraEnabled
|
public String profileId;
|
@AuraEnabled
|
public String userId;
|
@AuraEnabled
|
public String Status;
|
@AuraEnabled
|
public String LeadLink;
|
@AuraEnabled
|
public String OppNameSearch;
|
@AuraEnabled
|
public String ContactName;
|
@AuraEnabled
|
public String ContactId;
|
@AuraEnabled
|
public String HospitalName;
|
@AuraEnabled
|
public String HospitalID;
|
@AuraEnabled
|
public String DepartmentClass;
|
@AuraEnabled
|
public String DepartmentID;
|
@AuraEnabled
|
public String OppNameSearchID;
|
@AuraEnabled
|
public String Campaign;
|
@AuraEnabled
|
public String CampaignID;
|
@AuraEnabled
|
public String Name;
|
@AuraEnabled
|
public String CancelReason;
|
@AuraEnabled
|
public String Phone;
|
@AuraEnabled
|
public String Email;
|
@AuraEnabled
|
public String LastName;
|
@AuraEnabled
|
public String LeadSource;
|
@AuraEnabled
|
public String OpportunityDivision;
|
@AuraEnabled
|
public String Request1;
|
@AuraEnabled
|
public Boolean Urgent;
|
@AuraEnabled
|
public String FSEOwner;
|
@AuraEnabled
|
public String FSEOwnerId;
|
@AuraEnabled
|
public String FamilyName;
|
@AuraEnabled
|
public String JINGZHUOJISHU;
|
@AuraEnabled
|
public String Standard;
|
//add by Deloitte-王雪琴 2023/08/08start
|
@AuraEnabled
|
public String Company;
|
// @AuraEnabled
|
// public String AWSDataId;
|
@AuraEnabled
|
public String InquiryNum;
|
// @AuraEnabled
|
// public String InquiryAWSDataId;
|
// @AuraEnabled
|
// public String staticResource;
|
//add by Deloitte-王雪琴 2023/08/08 end
|
}
|
}
|