Commit 9463a474 by liuyang

2024-06-27 添加存货类型大类

parent 6b4f59bd
package com.baosight.hggp.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.*;
/**
* @author LiuYang
* @version 1.0 2024/6/27
*/
public enum InventTypeDetailEnum {
COMPONENT(1,"构件"),
SEMI_FINISHED_PRODUCT(2,"零件"),
RAW(3,"原料"),
CONSUMABLE(4,"耗材");
private Integer code;
private String value;
InventTypeDetailEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static InventTypeDetailEnum getEnumByCode(Integer code){
for (InventTypeDetailEnum en : InventTypeDetailEnum.values()){
if(code.compareTo(en.code)==0){
return en;
}
}
return null;
}
public static String getNameByCode(Integer code){
InventTypeDetailEnum en = getEnumByCode(code);
if(Objects.nonNull(en)){
return en.getValue();
}
return null;
}
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;
}
public static Integer[] getInentTypeTwo(){
return new Integer[]{COMPONENT.code,SEMI_FINISHED_PRODUCT.code};
}
public static Integer[] getProdTypeFour(){
return new Integer[]{COMPONENT.code,SEMI_FINISHED_PRODUCT.code,RAW.code,CONSUMABLE.code};
}
public static EiBlock generatorEiBlock() {
EiBlock block = new EiBlock("invent_type_detail_block_id");
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>() {{
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, COMPONENT.code + HGConstants.SPLICING_SYMBOL + COMPONENT.value);
put(HGConstants.VALUE_FIELD, COMPONENT.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, SEMI_FINISHED_PRODUCT.code + HGConstants.SPLICING_SYMBOL + SEMI_FINISHED_PRODUCT.value);
put(HGConstants.VALUE_FIELD, SEMI_FINISHED_PRODUCT.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, RAW.code + HGConstants.SPLICING_SYMBOL + RAW.value);
put(HGConstants.VALUE_FIELD, RAW.code);
}});
add(new HashMap<String, Object>() {{
put(HGConstants.TEXT_FIELD, CONSUMABLE.code + HGConstants.SPLICING_SYMBOL + CONSUMABLE.value);
put(HGConstants.VALUE_FIELD, CONSUMABLE.code);
}});
}};
block.setRows(rows);
return block;
}
}
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