GWY
2022-05-21 a3460549533111815e7f73d6cef601a58031525d
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
public with sharing class OpportunityAAdvancedController {
 
    public Opportunity opp { get; set; }
    public String oppId { get; private set; }
     public String baseUrl { get; set; }
 
    public Boolean FV3000Flag { get; private set; }
    public Boolean FVMPERSFlag { get; private set; }
    public Boolean SPINFlag { get; private set; }
    public Boolean VS200Flag { get; private set; }
    public Boolean PhaseviewFlag {get; private set; }
 
    public OpportunityAAdvancedController() { 
        
        baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        String path = URL.getCurrentRequestUrl().getPath();
        if (path.indexOf('/apex') > 0) {
            baseUrl += path.substring(0, path.indexOf('/apex'));
        }
        oppId = System.currentPageReference().getParameters().get('oppid');
 
        List<Opportunity> oppList = [select Id, 
                                     OppOtherDescription__c,OppPartyProduct__c,AC_objective_FVMPE_RS__c,
                                     Camera_SPIN__c,Customization_FV3000__c,Customization_FVMPE_RS__c,Detector_FV3000__c,
                                     detector_FVMPE_RS__c,FL_Camera_VS200__c,Frame_FV3000__c,Frame_FVMPE_RS__c,
                                     IR_laser_FVMPE_RS__c,Laser_FV3000__c,Laser_SPIN__c,Loader_VS200__c,Observation_Set_VS200__c,
                                     Remark_FV3000__c,Remark_FVMPE_RS__c,Remark_SPIN__c,Scanner_FV3000__c,Scanner_SPIN__c,
                                     SIM_FVMPE_RS__c,Software_FV3000__c,Software_FVMPE_RS__c,Software_SPIN__c,Software_VS200__c,
                                     Upgrade_SPIN__c,Upgrade_VS200__c,SystemNew__c 
                                     from Opportunity where Id = :oppId];
        if (oppList != null && oppList.size() >0) {
            opp = oppList[0];
        }
    }
    public OpportunityAAdvancedController(ApexPages.StandardController controller) {
        //获取询价ID
        oppId = controller.getRecord().Id;
        
        baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        String path = URL.getCurrentRequestUrl().getPath();
        if (path.indexOf('/apex') > 0) {
            baseUrl += path.substring(0, path.indexOf('/apex'));
        }
 
        List<Opportunity> oppList = [select Id,
                                     OppOtherDescription__c,OppPartyProduct__c,AC_objective_FVMPE_RS__c,
                                     Camera_SPIN__c,Customization_FV3000__c,Customization_FVMPE_RS__c,Detector_FV3000__c,
                                     detector_FVMPE_RS__c,FL_Camera_VS200__c,Frame_FV3000__c,Frame_FVMPE_RS__c,
                                     IR_laser_FVMPE_RS__c,Laser_FV3000__c,Laser_SPIN__c,Loader_VS200__c,Observation_Set_VS200__c,
                                     Remark_FV3000__c,Remark_FVMPE_RS__c,Remark_SPIN__c,Scanner_FV3000__c,Scanner_SPIN__c,
                                     SIM_FVMPE_RS__c,Software_FV3000__c,Software_FVMPE_RS__c,Software_SPIN__c,Software_VS200__c,
                                     Upgrade_SPIN__c,Upgrade_VS200__c,Light_sheet_illuminator_Phaseview__c,Laser_Phaseview__c,
                                     Camera_Phaseview__c,SystemNew__c 
                                     from Opportunity where Id = :oppId];
        if (oppList != null && oppList.size() >0) {
            opp = oppList[0];
        }
        
 
    }
 
    public PageReference init() {
 
        FV3000Flag = false;
        FVMPERSFlag = false;
        SPINFlag = false;
        VS200Flag = false;
        if (opp != null ) {
            // FV3000Flag = 'FV3000'.equals(opp.OppSystem__c) ? true:false;
            // FVMPERSFlag = 'FVMPE-RS'.equals(opp.OppSystem__c) ? true:false;
            // SPINFlag = 'SPIN'.equals(opp.OppSystem__c) ? true:false;
            // VS200Flag = 'VS200'.equals(opp.OppSystem__c) ? true:false;
            // system.debug(opp.SystemNew__c);
            String str = opp.SystemNew__c;
            if(str != null){
                FV3000Flag = str.contains('FV3000');
                FVMPERSFlag = str.contains('FVMPE-RS');
                SPINFlag = str.contains('SPIN');
                VS200Flag = str.contains('VS200');
                PhaseviewFlag = str.contains('Phaseview');
            }
 
        }
 
        return null;
    }
 
    public PageReference saveLine() {
 
        if (opp != null) {
            update opp;
        }
 
        return null;
    }
}