CRM-客户:添加分页数据场景过滤

This commit is contained in:
puhui999
2023-11-08 16:42:22 +08:00
parent 388e07c834
commit f4c92089e5
4 changed files with 62 additions and 4 deletions

View File

@ -0,0 +1,46 @@
package cn.iocoder.yudao.module.crm.enums.customer;
import cn.hutool.core.util.ObjUtil;
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
/**
* CRM 客户等级
*
* @author Wanwan
*/
@Getter
@AllArgsConstructor
public enum CrmCustomerSceneEnum implements IntArrayValuable {
OWNER(1, "我负责的客户"),
FOLLOW(2, "我关注的客户");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CrmCustomerSceneEnum::getType).toArray();
/**
* 场景类型
*/
private final Integer type;
/**
* 场景名称
*/
private final String name;
public static boolean isOwner(Integer type) {
return ObjUtil.equal(OWNER.getType(), type);
}
public static boolean isFollow(Integer type) {
return ObjUtil.equal(FOLLOW.getType(), type);
}
@Override
public int[] array() {
return ARRAYS;
}
}