Commit 8601809c by wuwenlong

产品类型枚举

parent e32cfb58
package com.baosight.hggp.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum ProductTypeEnum {
STRUCT(1,"构建"),
PART(2,"零件");
private Integer code;
private String value;
ProductTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("product_type_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, STRUCT.code + "-" + STRUCT.value);
put(HGConstants.VALUE_FIELD, STRUCT.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, PART.code + "-" + PART.value);
put(HGConstants.VALUE_FIELD, PART.code);
}});
}};
block.setRows(rows);
return block;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment