fourcal/src/main/java/cn/palmte/work/bean/StatusEnum.java

56 lines
1.3 KiB
Java
Raw Normal View History

package cn.palmte.work.bean;
/**
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
*/
public enum StatusEnum {
CREATED(1,"项目创建"),
ESTIMATE_ACCOUNTS(5,"概算完成"),
BUDGET_ACCOUNTS(10,"预算完成"),
SETTLE_ACCOUNTS(15,"结算中"),
FINAL_ACCOUNTS(20,"决算完成");
private int status;
private String statusDesc;
private StatusEnum(int status, String statusDesc) {
this.status = status;
this.statusDesc = statusDesc;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getStatusDesc() {
return statusDesc;
}
public void setStatusDesc(String statusDesc) {
this.statusDesc = statusDesc;
}
public static StatusEnum parseStatus(int status){
if(status == 1){
return CREATED;
}
if(status == 5){
return ESTIMATE_ACCOUNTS;
}
if(status == 10){
return BUDGET_ACCOUNTS;
}
if(status == 15){
return SETTLE_ACCOUNTS;
}
if(status == 20){
return FINAL_ACCOUNTS;
}
throw new IllegalArgumentException("Unkown status:"+status);
}
}