package cn.iocoder.yudao.module.aftersales.enums; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjUtil; import cn.iocoder.yudao.framework.common.core.ArrayValuable; import lombok.Getter; import lombok.RequiredArgsConstructor; import java.util.Arrays; /** * 售后业务类型枚举 */ @RequiredArgsConstructor @Getter public enum AfterSaleBizTypeEnum implements ArrayValuable { AFTER_SALE_TICKET(1, "售后工单"), AFTER_SALE_RETURN(2, "退货申请"), AFTER_SALE_REPAIR(3, "维修记录"), ; public static final Integer[] ARRAYS = Arrays.stream(values()) .map(AfterSaleBizTypeEnum::getType).toArray(Integer[]::new); private final Integer type; private final String name; public static String getNameByType(Integer type) { AfterSaleBizTypeEnum typeEnum = CollUtil.findOne(CollUtil.newArrayList(AfterSaleBizTypeEnum.values()), item -> ObjUtil.equal(item.type, type)); return typeEnum == null ? null : typeEnum.getName(); } @Override public Integer[] array() { return ARRAYS; } }