gzw
2022-02-15 168114b11da83c5005cd608c1b23a66311717a0f
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
public without sharing class ShipmentController {
    /*****************検索用******************/
    //public Consumable_order__c coc { get; set; }
    /*****************画面表示Bean******************/
    /*public List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecords { get; set; }
    public String baseUrl {get;private set;}
    //排序用
    public String sortKey { get; set; }
    public String preSortKey { get; private set; }
    public Boolean sortOrderAsc { get; private set; }
    public String[] sortOrder { get; private set; }
    private String[] columus = new String[]{ 'Name'};
    // 已选择备品set明细
    private List<Consumable_order_details__c> ConsumableorderdetailsSelected = new List<Consumable_order_details__c>();
 
    // 产品 ID
    private String ESetId = '';
    */
    public ShipmentController() {
        //Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
        //baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
        //ESetId = ApexPages.currentPage().getParameters().get('esetId');
        //ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
    }
    /*
    // 画面初始化
    public void init() {
        String userId = UserInfo.getUserId();
        List<user> Useracc = New List<user>();
        Useracc = [select accountid from user where id =:userId];
        String accountid = Useracc[0].accountid;
 
        coc = new Consumable_order__c();
        list<Dealer_elationship__c> Dealerelationship = new list<Dealer_elationship__c>();
        Dealerelationship = [select Dealer_subordinate__c,Dealer_subordinate__r.Name 
                                from Dealer_elationship__c
                                where Dealer_principal__c =:accountid ];
 
        ConsumableorderdetailsRecords = new List<ConsumableorderdetailsInfo>();
        List<Consumable_order_details__c> CountSet = new List<Consumable_order_details__c>();       
        if(ESetId== NULL || ESetId==''){
 
        }else{
 
            List<Consumable_order__c> qs = New List<Consumable_order__c>();
            qs = [select id,name,Order_reason__c,
                        Arrive_Order__c,
                        recordtypeid,
                        Order_status__c,
                        Deliver_date__c,
                        Order_ForHospital__c,
                        Order_ForDealer__r.Name
                    from Consumable_order__c
                    where id =:ESetId];
         if (qs.size()>0){
                coc = qs[0];
            }
            // 選択済みの明细を取得
            ConsumableorderdetailsSelected = [select Id,
                                                    Name,
                                                    Consumable_order__c,
                                                    Consumable_Product__c,
                                                    Consumable_Product__r.Name,
                                                    Sterilization_limit__c,
                                                    Consumable_Count__c,
                                                    Deliver_date__c,
                                                    Intra_Trade_List_RMB__c,
                                                    Asset_Model_No__c,
                                                    Sum_of_money__c
                                                from Consumable_order_details__c
                                                where  Consumable_Shipment_order__c = :ESetId
                                                order by Name ];
            //输出allnumber
            
            for (Integer i = 0; i < ConsumableorderdetailsSelected.size(); i++) {
                ConsumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(ConsumableorderdetailsSelected[i]));
            }
        }
        // 显示数据条数信息
        //makeMessage();
        this.sortKey = '1';
        this.preSortKey = '1';
        this.sortOrderAsc = false;
        this.sortOrder = new String[1];
        this.sortOrder = new String[]{'', '↓'};
    }
    //限制性排序
/*    public void SortLimited(){
        List<ConsumableorderdetailsInfo> reSet = new List<ConsumableorderdetailsInfo>();
        if (this.sortKey == this.preSortKey) {
            // 方向が変わるのみ
            this.sortOrderAsc = !this.sortOrderAsc;
            this.sortOrder[Integer.valueOf(this.sortKey)] = (this.sortOrderAsc == true ? '↑' : '↓');
        } else {
            this.sortOrderAsc = true;
            this.sortOrder[Integer.valueOf(this.preSortKey)] = '';
            this.sortOrder[Integer.valueOf(this.sortKey)] = (this.sortOrderAsc == true ? '↑' : '↓');
        }
        this.preSortKey = this.sortKey;
        if(EsetId==null||ESetId==''){
        }else{
        // 出库产品取得
        String soql = 'select Id,  Name, Consumable_order__c, Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,Consumable_Count__c,Deliver_date__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,Sum_of_money__c from Consumable_order_details__c where   Consumable_Shipment_order__c = \''+ESetId+'\'';
        soql += ' order by ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last');
        List<Consumable_order_details__c> queryList = Database.query(soql);
        // 選択済みの明细を取得
        Map<String, String> selectedIdMap = new Map<String, String>();
        for (Integer i = 0; i < queryList.size(); i++) {
            reSet.add(new ConsumableorderdetailsInfo(queryList[i]));
        } 
            ConsumableorderdetailsRecords = reSet;
            // 显示数据条数信息
        }
    }
    */
    // Data Bean
    /*class ConsumableorderdetailsInfo implements Comparable {
        public Boolean check { get; set; }
        public Boolean oldCheck { get; set; }
        public Consumable_order_details__c esd { get; set; }
        public Product2__c Prod { get; set; }
        public Decimal allmoney { get; set; }
        public Decimal allnumber { get; set; }
        public Decimal oldConsumableCount { get; set; }
        public Boolean canSelect { get; set; }
        
        // 已存在备品set明细用
        public ConsumableorderdetailsInfo(Consumable_order_details__c e) {
            check = true;
            oldCheck = true;
            esd = e;
            Prod = e.Consumable_Product__r;
            oldConsumableCount = e.Consumable_Count__c;
            canSelect = true; 
        }
        // 排序
        public Integer compareTo(Object compareTo) { 
            return null; 
        }  
    }*/
}