liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
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
    }
}