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
public with sharing class lexReturnDeliveryController {
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new InitData();
        try {
            res.flag = true;
            List<Consum_Apply_Equipment_Set_Detail__c> 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;
    }
}