buli
2023-06-05 3962c2bb0435484b60a3e408e4738d792e249a53
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
public without sharing class LexProductLimitEditController {
    public static String accountid { get; set; }
    public static String product_Limit { get; set; }
    //--------AddStart-----XHL--------------20180929-------------
    public static String userPro_Type { get; set; }
    public static Boolean EngFlag = false;
    public static Boolean ETFlag = false;  
    //--------AddEnd-----XHL--------------20180929-------------
    // 画面初始化
    public LexProductLimitEditController (){
        accountid= ApexPages.currentPage().getParameters().get('accountid');
        //--------AddStart-----XHL--------------20181008-------------
        userPro_Type= ApexPages.currentPage().getParameters().get('userPro_Type');
        if(String.isBlank(userPro_Type)){
            userPro_Type = 'ET';
        }
        if(userPro_Type == 'ENG'){
            EngFlag = true;
        }else{
            ETFlag = true;
        }
        //--------AddEnd-----XHL--------------20181008-------------
    }
    @AuraEnabled
    public static ResponseBodyLWC  init(String accountid,string userPro_Type) {
        System.debug('userPro_Type==>'+userPro_Type);
        System.debug('accountid==>'+accountid);
        ResponseBodyLWC res = new ResponseBodyLWC();
        Map<String,object> data = new Map<String,object>();
        res.entity = data;
        if(String.isBlank(userPro_Type)){
            userPro_Type = 'ET';
        }
        if(userPro_Type == 'ENG'){
            EngFlag = true;
        }else{
            ETFlag = true;
        }
 
        List<Account> accinfo = New List<Account>();
        //--------UpdateStart-----XHL--------------20181008-------------
        accinfo = [SELECT Product_Limit_Date__c,Product_Limit_DateENG__c
                    FROM Account
                    WHERE id =:accountid];
        if(accinfo.size() > 0){
            if(EngFlag){
               product_Limit = accinfo [0].Product_Limit_DateENG__c;
            }else if(ETFlag){
               product_Limit = accinfo [0].Product_Limit_Date__c;
            }
            
        }
        System.debug('product_Limit==>'+product_Limit);
        data.put('product_Limit',product_Limit);
        res.status = 'Success';
        res.code = 200;
        System.debug('res = ' + res);
        return res;
        //--------UpdateEnd-----XHL--------------20181008-------------
    }
}