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;
|
}
|
|
}
|