package com.matrix.system.enums;
|
|
import com.google.common.collect.Lists;
|
import com.matrix.core.enums.EnumApiShowAble;
|
import com.matrix.core.enums.EnumsShowVo;
|
import com.matrix.core.exception.GlobleException;
|
|
import java.util.List;
|
import java.util.stream.Collectors;
|
|
/**
|
* 操作按钮枚举
|
* @author jyy
|
*/
|
public enum OperationButtonEnum implements EnumApiShowAble {
|
|
CREATE(1, "新增"),
|
UPDATE(2, "修改"),
|
DELETE(3, "删除"),
|
CANCEL(4, "取消"),
|
INVALID(5, "设置为无效"),
|
EFFECTIVE(6, "设置为有效"),
|
ORDER_SK(7, "订单收款"),
|
ORDER_TK(8, "订单退款"),
|
ORDER_UPDATE_TIME(9, "更新订单时间"),
|
EXPORT(10, "导出"),
|
SERVICE_ORDER_BEGIN(11, "开始服务单"),
|
SERVICE_ORDER_END(12, "完成服务单"),
|
SERVICE_ORDER_PL(13, "服务单配料"),
|
SERVICE_ORDER_HK(14, "划扣"),
|
SERVICE_ORDER_PB(15, "排班"),
|
SERVICE_ORDER_QRYY(16, "确认预约"),
|
|
;
|
|
private Integer value;
|
|
private String displayName;
|
|
OperationButtonEnum(Integer value, String displayName) {
|
this.value = value;
|
this.displayName = displayName;
|
}
|
|
public static String getByValue(Integer value) {
|
for (int i = 0; i < values().length; i++) {
|
if (value.equals(values()[i].getValue())) {
|
return values()[i].displayName;
|
}
|
}
|
throw new GlobleException("无效枚举值");
|
}
|
|
@Override
|
public String getEnumCode() {
|
return "operationButton";
|
}
|
|
@Override
|
public List<EnumsShowVo> getEnumsShowVos() {
|
return Lists.newArrayList(values()).stream().map(item ->
|
EnumsShowVo.builder()
|
.displayName(item.getDisplayName())
|
.value(item.value)
|
.build()
|
).collect(Collectors.toList());
|
}
|
|
public Integer getValue() {
|
return value;
|
}
|
|
public String getDisplayName() {
|
return displayName;
|
}
|
|
}
|