高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
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
public without sharing class Morethan7daysController {
        // 订单 ID
        private String orderId = '';
        public List<showRecords> MorethansevendaysIifo { get; set; }
        public String type { get; set; }
        public Morethan7daysController() {
            orderId = ApexPages.currentPage().getParameters().get('Id');
            MorethansevendaysIifo = new List<showRecords>();
            type = ApexPages.currentPage().getParameters().get('type');
        }
    
        // 画面初始化
        public void init() {
            List<AggregateResult> Morethan7daysList = [SELECT Asset_Model_No__c prodModel,count(Id) recordCount FROM Consumable_order_details2__c
                            WHERE Consumable_order_minor__c != null 
                            AND Dealer_Shipment__c = false 
                            AND Dealer_Arrive__c = false 
                            AND Dealer_Saled__c = false 
                            AND Consumable_order_minor__r.showFalseNotshowTrue__c = false 
                            AND Deliver_date__c < LAST_N_DAYS:7
                            AND Consumable_order_minor__c = :orderId
                            GROUP BY Asset_Model_No__c];
                            
            for(Integer i = 0 ; i< Morethan7daysList.size() ; i++){
                MorethansevendaysIifo.add(new showRecords(Morethan7daysList[i]));
            }
        }
    
        // Data Bean
        class showRecords implements Comparable {
    
            public Decimal recordCount { get; set; }
            public String prodModel { get; set; }
    
    
            public showRecords(AggregateResult e) {
                recordCount =Integer.valueOf(e.get('recordCount'));
                prodModel = String.valueOf(e.get('prodModel'));
            }
            //排序
            public Integer compareTo(Object compareTo) {
                return null;
            }
        }
}