buli
2023-05-04 50b39c4b52bf5fd61ec46ada365c51e05a16d2ae
force-app/main/default/classes/LexSearchProductController.cls
@@ -14,7 +14,7 @@
   
    public class  InitData{
         @AuraEnabled
            @AuraEnabled
            public String Asset_Model_No;
            @AuraEnabled
            public String OT_CODE_no_link;
@@ -33,6 +33,30 @@
            @AuraEnabled
            public Decimal Packing_list_manual;
            @AuraEnabled
            public string VenderName;
            @AuraEnabled
            public Decimal Intra_Trade_Gurantee_RMB;
            @AuraEnabled
            public String GuranteeType;
            @AuraEnabled
            public boolean Estimation_Entry_Possibility;
            @AuraEnabled
            public boolean CostFlag;
            @AuraEnabled
            public Decimal Foreign_Trade_Cost_US;
            @AuraEnabled
            public Decimal Intra_Trade_Gurantee_USD;
            @AuraEnabled
            public Decimal Intra_Trade_Service_USD;
            @AuraEnabled
            public decimal Maintenance_Price_Year_USD;
            public InitData(Integer i, PricebookEntry pbe){
            this.Asset_Model_No=pbe.Product2.Asset_Model_No__c;
            this.OT_CODE_no_link=pbe.Product2.OT_CODE_no_link__c;
@@ -43,10 +67,37 @@
            this.Intra_Trade_List_RMB=pbe.Product2.Intra_Trade_List_RMB__c;
            this.Foreign_Trade_List_US=pbe.Product2.Foreign_Trade_List_US__c;
            this.Packing_list_manual = pbe.Product2.Packing_list_manual__c;
            this.Intra_Trade_Gurantee_USD = pbe.Product2.Intra_Trade_Foreign_RMB__c;
            //需要的隐藏数据
            this.Intra_Trade_Gurantee_RMB = pbe.Product2.Intra_Trade_Gurantee_RMB__c;
            this.GuranteeType=pbe.Product2.GuranteeType__c;
             if(pbe.Product2.Estimation_Entry_Possibility__c=='×' ){
                    this.Estimation_Entry_Possibility = true;
                }else{
                    this.Estimation_Entry_Possibility = false;
                }
            if(pbe.Product2.VenderName__c==null||
                    pbe.Product2.VenderName__c.trim().length() == 0){
                    this.VenderName =' 无 ';
                }
            else{
                    this.VenderName = pbe.Product2.VenderName__c;
            }
            if(pbe.Product2.Intra_Trade_Cost_RMB__c > 0 ){
                    this.CostFlag = false;
                }
            else{
                    this.CostFlag = true;
            }
            this.Foreign_Trade_Cost_US = pbe.Product2.Foreign_Trade_Cost_US__c;
            this.Intra_Trade_Service_USD = pbe.Product2.NoDiscount_Foreign__c;
            this.Maintenance_Price_Year_USD = pbe.Product2.Repair_Contract_USD__c;
    }
}
     public class ProductLine {
            @AuraEnabled
            public Integer idx;
@@ -245,17 +296,16 @@
        //20211123 lt update 450 原500
        searchSql += ' order by Product2.Asset_Model_No__c Limit 450';
        System.debug('searchSql::::::' + searchSql);
    System.debug('whereStr::::::' + whereStr);
    System.debug('whereSql::::::' + whereSql);
    // system.debug(searchSql);
    List<PricebookEntry> pbes = Database.query(searchSql);
    List<initData> res=new List<initData>();
    for (Integer i = 0; i < pbes.size(); i++) {
        initData pl = new initData(i, pbes[i]);
        res.add(pl);
    }
        System.debug('whereStr::::::' + whereStr);
        System.debug('whereSql::::::' + whereSql);
        List<PricebookEntry> pbes = Database.query(searchSql);
        List<initData> res=new List<initData>();
        for (Integer i = 0; i < pbes.size(); i++) {
            initData pl = new initData(i, pbes[i]);
            res.add(pl);
        }
        return res;
    }
        }
}