package com.unis.crk.enums;

import lombok.Getter;

/**
 * 仓储作业分类，库级专用，根据仓储作业分类枚举设定
 * @author Administrator
 *
 */
@Getter
public enum StoreWorkType {
	In((short)1),				//入仓
	InStore((short)2),			//仓内存储
	Out((short)3),				//出仓
	SiampleStore((short)4),	//简易存储
	QCKC((short)5),		//期初库存
	HcIn((short)6),				//火车入仓
	HcOut((short)7),				//火车出仓
	XZBH((short)10),				//性质变化 
	KcbdRk((short)12),		// 库存变动 入库
	KcbdCk((short)13),		// 库存变动 出库
	KcbdYc((short)14),		// 库存变动 损益(移仓操作)
	KcbdXz((short)15),		// 库存变动 性质变化
	KcbdPc((short)16),		// 库存变动 平仓
	Cpljgdj((short)17), 		// 成品粮加工登记
	CplCfRk((short)18),		// 成品商品拆分入库
	CplCfCk((short)19),		// 成品商品拆分出库
	CplZhRk((short)20),		// 成品粮商品组合入库
	CplZhCk((short)21),		// 成品粮商品组合出库
	CplDsCk((short)22),		// 电商出库
	CplDsThRk((short)23);		// 电商退货入库
 // 定义私有变量
    private Short nCode;
    // 构造函数，枚举类型只能为私有
    private StoreWorkType(Short _nCode) {
        this.nCode = _nCode;
    }
    
    @Override
    public String toString() {
        return String.valueOf(this.nCode);
    }
    
    public Short value(){
    	return this.nCode;
    }
    
    public static StoreWorkType valueOf(Short i)
    {
    	switch(i){
	    	case 1:
	    		return In;
        	case 2:
        		return InStore;
        	case 3:
        		return Out;
        	case 4:
        	  return SiampleStore;
        	 case 5:
             return QCKC;
        	 case 6:
        		 return HcIn;
        	 case 7:
        		 return HcOut;
        	 case 10:
        		 return XZBH;
        	 case 12:
        		 return KcbdRk;
        	 case 13:
        		 return KcbdCk;
        	 case 14:
        		 return KcbdYc;
        	 case 15:
        		 return KcbdXz;
        	 case 16:
        		 return KcbdPc;
        	 case 17:
        		 return Cpljgdj;
			 case 18:
				return CplCfRk;
			 case 19:
				return CplCfCk;
			case 20:
				return CplZhRk;
			case 21:
				return CplZhCk;
			case 22:
				return CplDsCk;
			case 23:
				return CplDsThRk;
        	default:
    			return null;
        }
    }
}
