Merge branch 'cc_20230520_partner' of http://gitlab.coolcollege.cn/hangzhou/java/coolstore-partner-manage into cc_20230520_partner
This commit is contained in:
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.60" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.0.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun.openservices:ons-client:1.8.8.3.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:ons20190214:1.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea-util:0.2.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:endpoint-util:0.0.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea:1.2.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jacoco:org.jacoco.agent:runtime:0.8.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea-openapi:0.0.19" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:credentials-java:0.2.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ini4j:ini4j:0.5.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.2.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.tencentyun:tls-sig-api-v2:2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.librepdf:openpdf:1.3.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -120,4 +120,6 @@ public class CommonConstants {
|
||||
|
||||
public static final String TRANSFER = "transfer";
|
||||
|
||||
public static final String FIX_MOBILE_OPENID_TEST = "HSAY5531DA7";
|
||||
public static final String FIX_MOBILE_OPENID_ONLINE = "HSAY4AF322E";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/19 19:48
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum AcceptAdjustTypeEnum {
|
||||
|
||||
NOT_ACCEPT(0,"不接受调剂"),
|
||||
NATIONAL_ADJUSTMENT(1,"全国调剂"),
|
||||
PROVINCIAL_ADJUSTMENT(2,"省内调剂"),
|
||||
LOCAL_ADJUSTMENT(3,"市区开放"),
|
||||
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
private String message;
|
||||
|
||||
AcceptAdjustTypeEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/19 19:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
public enum AreaStatusEnum {
|
||||
|
||||
|
||||
OPEN("open","开放"),
|
||||
NOT_OPEN("notOpen","未开放"),
|
||||
SATURATED("saturated","已饱和"),
|
||||
KEY_OPEN("keyOpen","重点开放"),
|
||||
|
||||
|
||||
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
AreaStatusEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -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 "";
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public enum ErrorCodeEnum {
|
||||
PARENT_NODE_NOT_EXIST(400002, "父节点不存在", null),
|
||||
|
||||
|
||||
LINE_ID_IS_NOT_EXIST(500001, "线索ID不存在!", null),
|
||||
LINE_ID_IS_NOT_EXIST(500001, "线索信息不存在!", null),
|
||||
WORK_FLOW_STAGE_PASS_ERROR(500002, "通过错误,非对应阶段!", null),
|
||||
PARTNER_USER_NOT_EXIST(500003, "加盟商用户信息不存在!", null),
|
||||
ZONE_NOT_EXIST(500004, "战区不存在!", null),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.cool.store.utils;
|
||||
|
||||
import com.cool.store.exception.ServiceException;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
/**
|
||||
* https://cloud.tencent.com/developer/article/1823249
|
||||
* 前后端约定
|
||||
*/
|
||||
public class AESDecryptor {
|
||||
|
||||
private static String Algorithm = "AES";
|
||||
private static String AlgorithmProvider = "AES/CBC/PKCS5Padding"; //算法/模式/补码方式
|
||||
|
||||
public static byte[] generatorKey() throws NoSuchAlgorithmException {
|
||||
KeyGenerator keyGenerator = KeyGenerator.getInstance(Algorithm);
|
||||
keyGenerator.init(256);//默认128,获得无政策权限后可为192或256
|
||||
SecretKey secretKey = keyGenerator.generateKey();
|
||||
return secretKey.getEncoded();
|
||||
}
|
||||
|
||||
public static IvParameterSpec getIv(byte[] ivstr) throws UnsupportedEncodingException {
|
||||
IvParameterSpec ivParameterSpec = new IvParameterSpec(ivstr);
|
||||
return ivParameterSpec;
|
||||
}
|
||||
|
||||
public static String encrypt(String src, String keystr, IvParameterSpec iv) throws
|
||||
NoSuchAlgorithmException,
|
||||
NoSuchPaddingException,
|
||||
InvalidKeyException,
|
||||
IllegalBlockSizeException,
|
||||
BadPaddingException,
|
||||
UnsupportedEncodingException,
|
||||
InvalidAlgorithmParameterException {
|
||||
byte[] key = keystr.getBytes("utf-8");
|
||||
SecretKey secretKey = new SecretKeySpec(key, Algorithm);
|
||||
IvParameterSpec ivParameterSpec = iv;
|
||||
Cipher cipher = Cipher.getInstance(AlgorithmProvider);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey, ivParameterSpec);
|
||||
byte[] cipherBytes = cipher.doFinal(src.getBytes(Charset.forName("utf-8")));
|
||||
return byteToHexString(cipherBytes);
|
||||
}
|
||||
|
||||
public static String decrypt(String src, String keystr) {
|
||||
try {
|
||||
byte[] key = keystr.getBytes("utf-8");
|
||||
SecretKey secretKey = new SecretKeySpec(key, Algorithm);
|
||||
IvParameterSpec ivParameterSpec = getIv(Arrays.copyOfRange(keystr.getBytes("utf-8"), 0, 16));
|
||||
Cipher cipher = Cipher.getInstance(AlgorithmProvider);
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
|
||||
byte[] hexBytes = hexStringToBytes(src);
|
||||
byte[] plainBytes = cipher.doFinal(hexBytes);
|
||||
return new String(plainBytes, "utf-8");
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将byte转换为16进制字符串
|
||||
*
|
||||
* @param src
|
||||
* @return
|
||||
*/
|
||||
public static String byteToHexString(byte[] src) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < src.length; i++) {
|
||||
int v = src[i] & 0xff;
|
||||
String hv = Integer.toHexString(v);
|
||||
if (hv.length() < 2) {
|
||||
sb.append("0");
|
||||
}
|
||||
sb.append(hv);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将16进制字符串装换为byte数组
|
||||
*
|
||||
* @param hexString
|
||||
* @return
|
||||
*/
|
||||
public static byte[] hexStringToBytes(String hexString) {
|
||||
hexString = hexString.toUpperCase();
|
||||
int length = hexString.length() / 2;
|
||||
char[] hexChars = hexString.toCharArray();
|
||||
byte[] b = new byte[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
int pos = i * 2;
|
||||
b[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private static byte charToByte(char c) {
|
||||
return (byte) "0123456789ABCDEF".indexOf(c);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
/* // 密钥必须是16的倍数
|
||||
String keystr = "0123456789ABCDEF";
|
||||
String ivstr = "0123456789101112";
|
||||
String src = "Hello World";
|
||||
|
||||
System.out.println("密钥:" + keystr);
|
||||
System.out.println("偏移量:" + ivstr);
|
||||
System.out.println("原字符串:" + src);
|
||||
IvParameterSpec iv = getIv(ivstr);
|
||||
String enc = encrypt(src, keystr, iv);
|
||||
System.out.println("加密:" + enc);
|
||||
*/
|
||||
String enc = "38395651e391c4b8ca327c4742b7f52f";
|
||||
String keystr = "77fea013c3a6459685b83c21a2fc3411";
|
||||
String ivstr = "77fea013c3a64596";
|
||||
// IvParameterSpec iv = getIv(ivstr);
|
||||
String dec = decrypt(enc, keystr);
|
||||
System.out.println("解密:" + dec);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.cool.store.utils;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.lowagie.text.Document;
|
||||
import com.lowagie.text.Image;
|
||||
@@ -12,8 +11,7 @@ import com.lowagie.text.pdf.PdfWriter;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.*;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Date;
|
||||
|
||||
//生成资格面试通过函的工具
|
||||
public class PassLetterUtils {
|
||||
@@ -26,7 +24,7 @@ public class PassLetterUtils {
|
||||
* @param passCode 通过函编码
|
||||
* @param passTime 审批通过时间
|
||||
*/
|
||||
public static ByteArrayOutputStream genPassLetter(String partnerName, String passCode, String verifyCity, DateTime passTime) {
|
||||
public static ByteArrayOutputStream genPassLetter(String partnerName, String passCode, String verifyCity, Date passTime) {
|
||||
String passTimeStr = DateUtil.format(passTime, "yyyy年MM月dd日");
|
||||
Document document = new Document();
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
@@ -65,7 +63,7 @@ public class PassLetterUtils {
|
||||
* 生成 passCode 的方法,拆分出来方便单独获取 passCode
|
||||
* @return
|
||||
*/
|
||||
public static String genPassCode(DateTime passTime) {
|
||||
public static String genPassCode(Date passTime) {
|
||||
String randomNum = RandomUtil.randomNumbers(5);
|
||||
String passCode = "HSAY" + DateUtil.format(passTime, "yyMMdd") + "-" + randomNum;
|
||||
return passCode;
|
||||
|
||||
Reference in New Issue
Block a user