buli
2022-04-26 5835379ec30b1667c4e522db9d294c9b7bb8633a
force-app/main/default/classes/NewCrossRegionalSalesController.cls
@@ -16,6 +16,10 @@
    public Boolean isIEDealer{get; set; }
    public String staticResource {get; set;}
    public String oppid {get; set;}
    public NewCrossRegionalSalesController() {
        baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        String path = URL.getCurrentRequestUrl().getPath();
@@ -36,12 +40,14 @@
        accId = System.currentPageReference().getParameters().get('accid');
        conId = System.currentPageReference().getParameters().get('conId');
        staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Opportunity'));
        List<Account> accList = [select Id, Name, ProductSegment__c,compo_Acc__c,UserType__c from Account where Id = :accId];
        if (accList.size() > 0) {
            acc = accList[0];
        }
        List<Contact> conList = [select Id, Name from Contact where Id = :conId];
        List<Contact> conList = [select Id, Name from Contact where Id = :conId];//pi
        if (conList.size() > 0) {
            con = conList[0];
        }
@@ -114,9 +120,9 @@
        Savepoint sp = Database.setSavepoint();
        try {
            //测试环境ID
            opp.RecordTypeId = '0120T0000002Vh9';
            //opp.RecordTypeId = '0120T0000002Vh9';
            //正式环境ID
            //opp.RecordTypeId = '0120K000000OpaG';
            opp.RecordTypeId = '0120K000000OpaG';
            opp.CrossCooperativeProject__c = true;
            insert opp;
@@ -139,8 +145,10 @@
            hasError = false;
            String url = baseUrl + '\\' + opp.Id;
            return new Pagereference(url);
            // String url = baseUrl + '\\' + opp.Id;
            // return new Pagereference(url);
            oppid = opp.id;
            return null;
        } catch (Exception e) {
            Database.rollback(sp);
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, e.getMessage()));