package com.platform.enums; import java.io.Serializable; public enum StorageStatus implements Serializable { waitInStorage("待入库",1,"ToAudit"), waitDeliver("待发货", 2, "Suspend"), waitSign ("待签收",3,"Package"), sign("已签收",4,"ManuallyHang"), rejection("已拒收",5,"AutoSuspended"); /** * 错误码 */ private String name; private int code; private String augustStatus; /** * Creates a new instance of ExceptionType. * * @param name code * @param code * @author Administrator 创建时间 2014年7月2日 下午8:00:15 */ StorageStatus(String name, int code, String augustStatus) { this.name = name; this.code = code; this.augustStatus = augustStatus; } /** * 获取code * * @return the code */ public int getCode() { return code; } public String getName() { return name; } public static String getNameByCode(int code) { for (StorageStatus payType : StorageStatus.values()) { if(payType.getCode() == code) { return payType.getName(); } } return ""; } public String getAugustStatus() { return augustStatus; } public static String getAugustStatusByCode(int code) { for (StorageStatus payType : StorageStatus.values()) { if(payType.getCode() == code) { return payType.getAugustStatus(); } } return ""; } public static String getNameByCode(String code) { for (StorageStatus payType : StorageStatus.values()) { if((payType.getCode()+"").equals(code)) { return payType.getName(); } } return ""; } }
枚举类
最新推荐文章于 2023-06-02 14:28:08 发布