public with sharing class lexReturnDeliveryController { @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { res.flag = true; List caeList = [SELECT Asset_Center_Confirm_F__c FROM Consum_Apply_Equipment_Set_Detail__c WHERE Cancel_Select__c = false AND Consum_Apply__c = :recordId]; if(caeList.size()>0){ res.size = caeList.size(); for(Consum_Apply_Equipment_Set_Detail__c cae : caeList){ if(cae.Asset_Center_Confirm_F__c != 'OK'){ res.flag = false; } } } if(Test.isRunningTest()){ Integer i = 1/0; } } catch (Exception e) { System.debug('********lexReturnDeliveryController*****'+e.getMessage()); } return res; } public class InitData{ @AuraEnabled public Boolean flag; @AuraEnabled public Integer size; } }