企业开通相关逻辑整理
This commit is contained in:
@@ -24,6 +24,13 @@ public class CommonConstants {
|
||||
|
||||
public static final int THREE_DAY_SECONDS = 60*60*24*3;
|
||||
|
||||
/**
|
||||
* 企业开通锁存活时间
|
||||
*/
|
||||
public static final int ENTERPRISE_OPEN_LOCK_TIMES = 4 * 60 * 60 * 1000;
|
||||
|
||||
public static final int ONE_DAY_SECONDS = 24 * 60 * 60;
|
||||
|
||||
/**
|
||||
* 系统用户id
|
||||
*/
|
||||
@@ -34,6 +41,33 @@ public class CommonConstants {
|
||||
public static final String WX_APP_SECRET_KEY = "wx_app_secret_key:{0}";
|
||||
public static final String MINI_PROGRAM_SESSION_KEY = "mini_program_session_key:{0}:{1}";
|
||||
|
||||
public static final String MaxReconsumeTimes = "2";
|
||||
public static final String ENTERPRISE_OPEN_STATUS_KEY = "enterprise_open_status:{0}_{1}";
|
||||
|
||||
public static final String ROOT_DEPT_ID_STR = "1";
|
||||
|
||||
public static final Integer DEAL_RECORD_MAX_SIZE = 1000;
|
||||
|
||||
/**
|
||||
* 未分组区域id
|
||||
*/
|
||||
public static final Long UNGROUPED_DEPT_ID = -2L;
|
||||
|
||||
/**
|
||||
* 未分组区域名称
|
||||
*/
|
||||
public static final String UNGROUPED_DEPT_NAME = "默认分组";
|
||||
|
||||
/**
|
||||
* 拼接符 [
|
||||
*/
|
||||
public static final String SQUAREBRACKETSLEFT = "[";
|
||||
|
||||
/**
|
||||
* 拼接符 ]
|
||||
*/
|
||||
public static final String SQUAREBRACKETSRIGHT = "]";
|
||||
|
||||
|
||||
public static final int ZERO = 0;
|
||||
public static final int ONE = 1;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
public enum AIEnum {
|
||||
|
||||
AI_NAME("AI用户"),
|
||||
AI_USERID("a100000001"),
|
||||
AI_ID("a100000000"),
|
||||
AI_DEPARTMENT("[1]"),
|
||||
AI_ROLES("20000000"),
|
||||
AI_UUID("a100000002"),
|
||||
AI_MOBILE("AIAdminUser");
|
||||
|
||||
|
||||
|
||||
private void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
private String code;
|
||||
AIEnum(String code){
|
||||
this.code=code;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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 "";
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,8 @@ public enum ErrorCodeEnum {
|
||||
GET_APP_SECRET_ERROR(1021020, "获取secret异常", null),
|
||||
WX_SERVICE_ERROR(1021021, "调用微信服务异常", null),
|
||||
SESSION_KEY_ERROR(1021022, "sessionKey过期", null),
|
||||
GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null)
|
||||
GET_WECHAT_USER_INFO_FAIL(1021023,"获取小程序用户信息失败", null),
|
||||
FEISHU_SERVICE_ERROR(1021024,"飞书服务调用异常", null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ListUtils
|
||||
* @Description: 集合处理
|
||||
* @date 2022-03-04 20:04
|
||||
*/
|
||||
public class ListOptUtils {
|
||||
|
||||
public static <T> List<T> getIntersection(List<T> listA, List<T> listB){
|
||||
if(CollectionUtils.isEmpty(listA) || CollectionUtils.isEmpty(listB)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return listA.stream().filter(item -> listB.contains(item)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* long集合转Stirng集合
|
||||
* @param listA
|
||||
* @return
|
||||
*/
|
||||
public static List<String> longListConvertStringList(List<Long> listA){
|
||||
List<String> result = Lists.newArrayList();
|
||||
if(CollectionUtils.isEmpty(listA)){
|
||||
return result;
|
||||
}
|
||||
for (Long temp:listA) {
|
||||
result.add(String.valueOf(temp));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user