1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
| package cn.iocoder.yudao.module.crm.enums.common;
|
| 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;
|
| /**
| * CRM 业务类型枚举
| *
| * @author HUIHUI
| */
| @RequiredArgsConstructor
| @Getter
| public enum CrmBizTypeEnum implements ArrayValuable<Integer> {
|
| CRM_CLUE(1, "线索"),
| CRM_CUSTOMER(2, "客户"),
| CRM_CONTACT(3, "联系人"),
| CRM_BUSINESS(4, "商机"),
| CRM_CONTRACT(5, "合同"),
| CRM_PRODUCT(6, "产品"),
| CRM_RECEIVABLE(7, "回款"),
| CRM_RECEIVABLE_PLAN(8, "回款计划"),
| CRM_SALE_QUOTATION(9, "销售报价")
| ;
|
| public static final Integer[] ARRAYS = Arrays.stream(values()).map(CrmBizTypeEnum::getType).toArray(Integer[]::new);
|
| /**
| * 类型
| */
| private final Integer type;
| /**
| * 名称
| */
| private final String name;
|
| public static String getNameByType(Integer type) {
| CrmBizTypeEnum typeEnum = CollUtil.findOne(CollUtil.newArrayList(CrmBizTypeEnum.values()),
| item -> ObjUtil.equal(item.type, type));
| return typeEnum == null ? null : typeEnum.getName();
| }
|
| @Override
| public Integer[] array() {
| return ARRAYS;
| }
|
| }
|
|