P15GEN2\59518
2025-10-10 9f6890646993d16260d4201d613c092132856127
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
package biz.constants;
 
public enum MdSubject {
    
    Account("md_org_account", "account_id", true, new String[] {"account_id", "account_code", "account_name"}),
    AccountWarehouse("wm_warehouse", "warehouse_id", true, new String[] {"warehouse_id", "warehouse_code", "warehouse_name","account_id", "account_code", "account_name"}),
    Warehouse("wm_warehouse", "warehouse_id", true, new String[] {"warehouse_id", "warehouse_code", "warehouse_name"}),
    Employee("md_employee", "employee_id", false, new String[] {"employee_id", "employee_code", "employee_name"}),
    Position("md_position", "position_id", false, new String[] {"position_id", "territory_id", "region"}),
    BU("md_bu", "account_id", false, new String[] {"bu_id", "bu_name"}),
    Product("md_product", "product_id", false, new String[] {"product_id", "product_code", "product_name"}),
    Sku("md_prod_sku", "sku_id", false, new String[] {"sku_id", "spec", "product_id", "product_code", "product_name"}),
    BatchSn("", "", false, new String[] {"sku_id", "spec", "product_id", "product_code", "product_name"}),
    Valid("", "", false, new String[] {"valid_from", "valid_to"}),
    Company("md_org_master", "company_id", false, new String[] {"company_id", "company_name"}),
    ;
 
    private String dataName;
    private String id;
    private String[] mainFields;
    private boolean hasDirection;
 
    public static MdSubject parse(String code) {
        for (MdSubject subject : MdSubject.values()) {
            if (subject.name().equalsIgnoreCase(code)) {
                return subject;
            }
        }
        
        return null;
    }
    
    private MdSubject(String dataName, String id, boolean hasDirection, String[]mainFields) {
        this.id = id;
        this.dataName = dataName;
        this.mainFields = mainFields;
        this.hasDirection = hasDirection;
    }
 
    public String getId() {
        return id;
    }
 
    public String getDataName() {
        return dataName;
    }
 
    public String[] getMainFields() {
        return mainFields;
    }
 
    public boolean hasDirection() {
        return hasDirection;
    }
}