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
public with sharing class Consumable_order_AlertController {
    public String idl {get; set;}
    public boolean IS_Alert_Price_Apply {get; set;}
    public ID userid {get; set;}
    public Consumable_order_AlertController() {
        idl = ApexPages.currentPage().getParameters().get('id');
        
    }
    public Consumable_order_AlertController(ApexPages.StandardController controller) {
        idl = ApexPages.currentPage().getParameters().get('id');
        
    }
    public void init() {
        list<Consumable_order__c> COList = 
            [select id, SalesManager__c,RecordTypeId, Order_type__c, Order_status__c 
                from Consumable_order__c where id =:idl];
        if(COList!=null && COList.size() > 0){
            IS_Alert_Price_Apply = false;
            userid = UserInfo.getUserId();
            if( COList[0].SalesManager__c != null 
                && COList[0].SalesManager__c == userid 
                && COList[0].RecordTypeId.equals(System.label.consumable_1)
                && COList[0].Order_type__c.equals('订单')
                && COList[0].Order_status__c.equals('已提交')){
                IS_Alert_Price_Apply = true;
                
            }
            //IS_Alert_Price_Apply = true;
        }
 
    }
}