add interface
This commit is contained in:
@@ -1,213 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 应用类型
|
||||
*/
|
||||
public enum AppTypeEnum {
|
||||
// 数智门店-钉钉
|
||||
DING_DING("dingding","数智门店-钉钉"),
|
||||
|
||||
//酷店掌-钉钉
|
||||
DING_DING2("dingding2","酷店掌-钉钉"),
|
||||
|
||||
// 企业微信-数智门店
|
||||
WX_APP("qw","数智门店-企业微信"),
|
||||
|
||||
// 企业微信-酷店掌
|
||||
WX_APP2("qw2","酷店掌-企业微信"),
|
||||
|
||||
//用户自己添加 独立app
|
||||
APP("app","数智门店-客户端"),
|
||||
|
||||
/**
|
||||
* 酷店掌-自建企业微信
|
||||
*/
|
||||
WX_SELF_APP("qw_self", "酷店掌-自建企业微信"),
|
||||
|
||||
/**
|
||||
* 酷店掌-自建企业微信代开发
|
||||
*/
|
||||
WX_SELF_DKF("qw_self_dkf", "酷店掌--自建企业微信代开发"),
|
||||
|
||||
/**
|
||||
* 酷店掌-企业微信私服
|
||||
*/
|
||||
WX_PRIVATE_APP("qw_private", "酷店掌-企业微信私服"),
|
||||
|
||||
WX_PRIVATE_ZHOU("qw_private_zdf","酷店掌-企业微信私服-周大福"),
|
||||
|
||||
/**
|
||||
* 门店通应用
|
||||
*/
|
||||
ONE_PARTY_APP("one_party", "门店通-钉钉"),
|
||||
|
||||
/**
|
||||
* 飞书
|
||||
*/
|
||||
FEI_SHU("fei_shu", "飞书")
|
||||
|
||||
;
|
||||
private String value;
|
||||
|
||||
private String message;
|
||||
|
||||
private static final Map<String, AppTypeEnum> map = Arrays.stream(values()).collect(Collectors.toMap(AppTypeEnum::getValue, Function.identity()));
|
||||
|
||||
AppTypeEnum(String value, String message) {
|
||||
this.value = value;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static String getMessage(String value){
|
||||
if(StringUtils.isBlank(value)){
|
||||
return "";
|
||||
}
|
||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
||||
if(appTypeEnum.value.equals(value)){
|
||||
return appTypeEnum.message;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static AppTypeEnum getAppType(String appType){
|
||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
||||
if(appTypeEnum.value.equals(appType)){
|
||||
return appTypeEnum;
|
||||
}
|
||||
}
|
||||
if(appType.startsWith(WX_SELF_APP.getValue())) {
|
||||
return WX_SELF_APP;
|
||||
}
|
||||
if(appType.startsWith(WX_PRIVATE_APP.getValue())) {
|
||||
return WX_PRIVATE_APP;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是钉钉平台
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isDingType(String value) {
|
||||
if (DING_DING.getValue().equals(value) || DING_DING2.getValue().equals(value) || ONE_PARTY_APP.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是企业微信平台
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isQwType(String value) {
|
||||
if (WX_APP.getValue().equals(value) || WX_APP2.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是飞书
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isFsType(String value) {
|
||||
if (FEI_SHU.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是酷店掌
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isCoolStore(String value) {
|
||||
if (WX_APP2.getValue().equals(value) || DING_DING2.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是数智门店
|
||||
* @param value
|
||||
* @author: xugangkun
|
||||
* @return java.lang.Boolean
|
||||
* @date: 2021/10/26 15:03
|
||||
*/
|
||||
public static Boolean isCoolCollege(String value) {
|
||||
if (WX_APP.getValue().equals(value) || DING_DING.getValue().equals(value)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是企微自建应用或者企微私服
|
||||
* @param appType
|
||||
* @return
|
||||
*/
|
||||
public static boolean isWxSelfAndPrivateType(String appType) {
|
||||
if(StringUtils.isBlank(appType)){
|
||||
return false;
|
||||
}
|
||||
return appType.startsWith(AppTypeEnum.WX_SELF_APP.getValue())
|
||||
|| appType.startsWith(AppTypeEnum.WX_PRIVATE_APP.getValue());
|
||||
}
|
||||
|
||||
public static boolean qwIsGetUserName(String appType){
|
||||
if(StringUtils.isBlank(appType) || isDingType(appType)){
|
||||
return false;
|
||||
}
|
||||
return appType.startsWith(AppTypeEnum.WX_SELF_APP.getValue()) || appType.startsWith(AppTypeEnum.WX_PRIVATE_APP.getValue())
|
||||
|| appType.startsWith(AppTypeEnum.WX_SELF_DKF.getValue()) || appType.startsWith(AppTypeEnum.WX_PRIVATE_ZHOU.getValue());
|
||||
}
|
||||
|
||||
public static String getCode(String value){
|
||||
if(StringUtils.isBlank(value)){
|
||||
return "";
|
||||
}
|
||||
for (AppTypeEnum appTypeEnum : AppTypeEnum.values()) {
|
||||
if(appTypeEnum.message.equals(value)){
|
||||
return appTypeEnum.value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static AppTypeEnum parseValue(String value) {
|
||||
return map.get(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* describe:
|
||||
*
|
||||
* @author zhouyiping
|
||||
* @date 2020/10/13
|
||||
*/
|
||||
public enum AuthRoleEnum {
|
||||
/**
|
||||
* 全企业数据
|
||||
*/
|
||||
ALL("all", "全企业数据"),
|
||||
|
||||
/**
|
||||
* 所在组织架构包含下级
|
||||
*/
|
||||
INCLUDE_SUBORDINATE("include_subordinate","所在组织架构包含下级"),
|
||||
|
||||
|
||||
// /**
|
||||
// * 所在的组织架构不包含下级
|
||||
// */
|
||||
NOT_INCLUDE_SUBORDINATE("not_include_subordinate","所在的组织架构不包含下级"),
|
||||
|
||||
/**
|
||||
* 仅自己的数据
|
||||
*/
|
||||
PERSONAL("personal","仅自己的数据");
|
||||
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
protected static final Map<String, AuthRoleEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(AuthRoleEnum::getCode, Function.identity()));
|
||||
|
||||
AuthRoleEnum(String code, String msg){
|
||||
this.code=code;
|
||||
this.msg=msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
public static AuthRoleEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: EnterpriseStatusEnum
|
||||
* @Description:
|
||||
* @date 2021-09-17 15:53
|
||||
*/
|
||||
public enum EnterpriseStatusEnum {
|
||||
|
||||
/**
|
||||
* 状态-1 已删除 0初始 1正常 100冻结 88创建失败
|
||||
*/
|
||||
|
||||
DELETED(-1,"已删除"),
|
||||
INIT(0,"初始"),
|
||||
NORMAL(1,"正常"),
|
||||
FREEZE(100,"冻结"),
|
||||
CREATE_FAIL(88,"创建失败"),
|
||||
;
|
||||
|
||||
|
||||
private int code;
|
||||
private String message;
|
||||
|
||||
EnterpriseStatusEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static String getMessage(Integer code){
|
||||
if(Objects.isNull(code)){
|
||||
return "";
|
||||
}
|
||||
for (EnterpriseStatusEnum value : EnterpriseStatusEnum.values()) {
|
||||
if(code.equals(value.code)){
|
||||
return value.message;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author Aaron
|
||||
* @Description 业务统一返回码
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
public enum RegionTypeEnum {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
ROOT("root", "根节点"),
|
||||
|
||||
|
||||
PATH("path", "区域"),
|
||||
|
||||
|
||||
STORE("store", "门店");
|
||||
|
||||
|
||||
private String type;
|
||||
|
||||
|
||||
private String desc;
|
||||
|
||||
RegionTypeEnum(String type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.management.relation.Role;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public enum RoleEnum {
|
||||
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
MASTER("20000000", "管理员", 1,"master"),
|
||||
/**
|
||||
* 子管理员
|
||||
*/
|
||||
SUB_MASTER("80000000", "子管理员", 2,"sub_master"),
|
||||
/**
|
||||
* 普通员工
|
||||
*/
|
||||
EMPLOYEE("30000000", "未分配", 99999999,"employee"),
|
||||
/**
|
||||
* 部门负责人
|
||||
*/
|
||||
DEPT_LEADER("40000000", "部门负责人", 10,"dept_leader"),
|
||||
/**
|
||||
* 店长
|
||||
*/
|
||||
SHOPOWNER("50000000", "店长", 3,"shopowner"),
|
||||
/**
|
||||
* 运营
|
||||
*/
|
||||
OPERATOR("60000000", "运营", 4,"operator"),
|
||||
/**
|
||||
* 店员
|
||||
*/
|
||||
CLERK("70000000", "店员", 5,"clerk");
|
||||
|
||||
|
||||
private static final Map<String, RoleEnum> MAP = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(RoleEnum::getRoleEnum, Function.identity()));
|
||||
|
||||
private static final Map<String, RoleEnum> ROLE_ID_MAP = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(RoleEnum::getId, Function.identity()));
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
@Getter
|
||||
@Setter
|
||||
private Integer priority;
|
||||
|
||||
private String roleEnum;
|
||||
|
||||
|
||||
RoleEnum(String id, String name, Integer priority, String roleEnum) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.priority = priority;
|
||||
this.roleEnum=roleEnum;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getRoleEnum() {
|
||||
return roleEnum;
|
||||
}
|
||||
|
||||
public static RoleEnum getByCode(String code) {
|
||||
return MAP.get(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是管理员 及 子管理员
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAdmin(String code){
|
||||
if(MASTER.getRoleEnum().equals(code) || SUB_MASTER.getRoleEnum().equals(code)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id 判断 是否是管理员 及 子管理员
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public static boolean isAdminById(String id){
|
||||
if(MASTER.getId().equals(id) || SUB_MASTER.getId().equals(id)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否包含角色id
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
public static boolean isContainsRoleId(String roleId){
|
||||
return ROLE_ID_MAP.containsKey(roleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 门店删除状态枚举
|
||||
*/
|
||||
public enum StoreIsDeleteEnum {
|
||||
EFFECTIVE("effective"),//有效
|
||||
|
||||
INVALID("invalid"),//无效
|
||||
|
||||
IGNORED("ignored"), //忽略
|
||||
|
||||
UN_SYNC("unSync"); // 未同步
|
||||
|
||||
private final String value;
|
||||
|
||||
private static final Map<String, StoreIsDeleteEnum> map = Arrays.stream(values()).collect(Collectors.toMap(StoreIsDeleteEnum::getValue, Function.identity()));
|
||||
|
||||
StoreIsDeleteEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static StoreIsDeleteEnum parse(int value) {
|
||||
return map.get(value);
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wxp
|
||||
* @FileName: SubordinateSourceEnum
|
||||
* @Description: auto自动关联 select手动选择
|
||||
* @date 2022-12-30 17:12
|
||||
*/
|
||||
public enum SubordinateSourceEnum {
|
||||
|
||||
AUTO("auto", "关联区域门店权限"),
|
||||
SELECT("select", "手动选择");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
protected static final Map<String, SubordinateSourceEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(SubordinateSourceEnum::getCode, Function.identity()));
|
||||
|
||||
SubordinateSourceEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static SubordinateSourceEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zyp
|
||||
*/
|
||||
public enum UserAuthMappingTypeEnum {
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
REGION("region","区域"),
|
||||
/**
|
||||
* 门店
|
||||
*/
|
||||
STORE("store","门店");
|
||||
|
||||
private String code;
|
||||
private String desc;
|
||||
public static final Map<String, UserAuthMappingTypeEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(UserAuthMappingTypeEnum::getCode, Function.identity()));
|
||||
|
||||
UserAuthMappingTypeEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static UserAuthMappingTypeEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: UserPositionEnum
|
||||
* @Description:用户身份
|
||||
* @date 2023-06-19 16:37
|
||||
*/
|
||||
public enum UserPositionEnum {
|
||||
|
||||
INVESTMENT_MANAGER("investment_manager", "招商经理"),
|
||||
INVESTMENT_LEADER("investment_leader", "招商负责人"),
|
||||
DEVELOPMENT_DIRECTOR("development_director", "开发主管"),
|
||||
DEVELOPMENT_MANAGER("development_manager", "开发经理"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
UserPositionEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wxp
|
||||
* @FileName: UserSelectRangeEnum
|
||||
* @Description: 用户选取范围 共同编辑人范围:self-仅自己,all-全部人员,define-自定义
|
||||
* @date 2022-12-30 17:12
|
||||
*/
|
||||
public enum UserSelectRangeEnum {
|
||||
|
||||
SELF("self", "仅自己"),
|
||||
ALL("all", "全部人员"),
|
||||
DEFINE("define", "自定义");
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
protected static final Map<String, UserSelectRangeEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(UserSelectRangeEnum::getCode, Function.identity()));
|
||||
|
||||
UserSelectRangeEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public static UserSelectRangeEnum getByCode(String code) {
|
||||
return map.get(code);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user