P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
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
package book.rebate;
 
import book.BookName;
import book.FreezeCondition;
import book.OrderRight;
import book.QtyCommand;
import book.StockType;
import foundation.dao.DataSource;
import foundation.data.entity.Entity;
 
public class BookCommandMeta {
 
    private String id;
    private BookName bookName;
    private String code;
    private String name;
    private String docType;
    private OrderRight orderRight;
    private StockType stockType;
    private QtyCommand qtyCommand;
    private boolean negativeConvert;
    private FreezeCondition freezeCondition;
    private String bookSource;
    private String warehouseDirection;
    private String filter;
    private String dataSource;
    
 
    public void load(Entity entity) {
        id = entity.getString("id");
        bookName = BookName.parse(entity.getString("book_name"));
        code = entity.getString("code");
        name = entity.getString("name");
        docType = entity.getString("doc_type");
        
        orderRight = OrderRight.parse(entity.getString("order_right"));
        stockType = StockType.parse(entity.getString("stock_type"));
 
        qtyCommand = new QtyCommand();
        qtyCommand.load(entity);
        
        negativeConvert = entity.getBoolean("is_negative_convert", false);
        freezeCondition = FreezeCondition.parse(entity.getString("freeze_condition"));
        warehouseDirection = entity.getString("warehouse_direction");
        bookSource = entity.getString("book_source", "rebate_id");
        dataSource = entity.getString("data_source");
        
        filter = entity.getString("filter", "1=1");
    }
    
    public String getId() {
        return id;
    }
    
    public BookName getBookName() {
        return bookName;
    }
 
    public String getCode() {
        return code;
    }
    
    public String getName() {
        return name;
    }
 
    public String getDocType() {
        return docType;
    }
    
    public OrderRight getOrderRight() {
        return orderRight;
    }
 
    public StockType getStockType() {
        return stockType;
    }
 
    public QtyCommand getQtyCommand() {
        return qtyCommand;
    }
 
    public boolean isNegativeConvert() {
        return negativeConvert;
    }
 
    public String getWarehouseDirection() {
        return warehouseDirection;
    }
 
    public DataSource getDataSource() {
        if ("file".equalsIgnoreCase(dataSource)) {
            return DataSource.File;
        }
        if ("request".equalsIgnoreCase(dataSource)) {
            return DataSource.Request;
        }
        
        return DataSource.DB;
    }
 
    public String getBookSource() {
        return bookSource;
    }
    
    public FreezeCondition getFreezeCondition() {
        return freezeCondition;
    }
 
    public String getFilter() {
        return filter;
    }
 
}