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 data = new Map(); res.entity = data; if (String.isBlank(userPro_Type)) { userPro_Type = 'ET'; } if (userPro_Type == 'ENG') { EngFlag = true; } else { ETFlag = true; } List accinfo = new List(); //--------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------------- } }