| | |
| | | //--------AddStart-----XHL--------------20180929------------- |
| | | public static String userPro_Type { get; set; } |
| | | public static Boolean EngFlag = false; |
| | | public static Boolean ETFlag = false; |
| | | public static Boolean ETFlag = false; |
| | | //--------AddEnd-----XHL--------------20180929------------- |
| | | // 画面初始化 |
| | | public LexProductLimitEditController() { |
| | | accountid = ApexPages.currentPage().getParameters().get('accountid'); |
| | | 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= ApexPages.currentPage().getParameters().get('userPro_Type'); |
| | | if(String.isBlank(userPro_Type)){ |
| | | userPro_Type = 'ET'; |
| | | } |
| | | if (userPro_Type == 'ENG') { |
| | | if(userPro_Type == 'ENG'){ |
| | | EngFlag = true; |
| | | } else { |
| | | }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); |
| | | 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>(); |
| | | Map<String,object> data = new Map<String,object>(); |
| | | res.entity = data; |
| | | if (String.isBlank(userPro_Type)) { |
| | | if(String.isBlank(userPro_Type)){ |
| | | userPro_Type = 'ET'; |
| | | } |
| | | if (userPro_Type == 'ENG') { |
| | | if(userPro_Type == 'ENG'){ |
| | | EngFlag = true; |
| | | } else { |
| | | }else{ |
| | | ETFlag = true; |
| | | } |
| | | |
| | | List<Account> accinfo = new List<Account>(); |
| | | 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; |
| | | 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); |
| | | System.debug('product_Limit==>'+product_Limit); |
| | | data.put('product_Limit',product_Limit); |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | System.debug('res = ' + res); |