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
/**
 * *
    ODescription:
    GAuthor: sun xia
    @Date: 2023-07-11 15:31:56
    GIastEditors: sun xia
    @IastEditTime: 2023-07-11 15:31:56
 * */
public with sharing class lexRentalFixtureSetAssignController {
    
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new InitData();
        try {
            Rental_Apply__c ra = [SELECT Id, Campaign__c, Campaign__r.Status, Repair__c, Repair_Final_Inspection_Date_F__c, RC_return_to_office__c,
                                    Status__c, Rental_Apply_Equipment_Set_Cnt__c, demo_purpose2__c, AccDealerBlacklist__c ,Hospital__r.IFTradeComplianceIntercept2__c,
                                    AccDealerBlacklist2__c   //20240121 sx 贸易合规二期冻结/黑名单拆开  add
                                    FROM Rental_Apply__c where Id = :recordId];
            
            res.ra = ra;
            System.debug('ra.Campaign__c=='+ra.Campaign__c);
            if(ra.Campaign__c != null){
                String campId = ra.Campaign__c;
                Campaign camp = [SELECT Id, Status FROM Campaign Where Id = :campId];
                res.CampaignStatus = camp.Status;
            }
            //贸易合规二期 add sx start
            if (ra.Hospital__r.IFTradeComplianceIntercept2__c =='intercept') {
                res.IFTradeComplianceIntercept2 = '1';
            }else if(ra.Hospital__r.IFTradeComplianceIntercept2__c =='Freeze') {
                res.IFTradeComplianceIntercept2 = '2';
            }
            //贸易合规二期 add sx end
            System.debug('res==='+res);
            return res;
        }
        catch (Exception e) {
            System.debug('lexRentalFixtureSetAssignControllerError==='+e);
        }
        return null;
    }
 
 
    public class InitData{
        @AuraEnabled
        public Rental_Apply__c ra;
        @AuraEnabled
        public String CampaignStatus;
        @AuraEnabled
        public String IFTradeComplianceIntercept2;        //贸易合规二期 add sx
    }
}