Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
聂康
local-rnr-custome
Commits
88ce9651
Commit
88ce9651
authored
Jun 17, 2025
by
kang.nie@inzymeits.com
Browse files
初始化代码
parent
00477413
Pipeline
#3106
failed with stages
in 0 seconds
Changes
103
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
88ce9651
#Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
*/bin/
*/gen/
*/out/
# Gradle files
.gradle/
build/
*/build/
gradlew
gradlew.bat
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
*/*.iml
# Keystore files
#*.jks
#gradle wrapper
gradle/
#some local files
*/.settings/
*/.DS_Store
.DS_Store
*/.idea/
.idea/
gradlew
gradlew.bat
unused.txt
# Eclipse Project files
.classpath
.project
.settings/
.factorypath
*/target/
# Nodejs files
*/node-modules/
\ No newline at end of file
pom.xml
0 → 100644
View file @
88ce9651
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
cusc-parent
</artifactId>
<version>
1.2.1-SNAPSHOT
</version>
<relativePath/>
</parent>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
local-rnr-customer
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
<mysql-connector-j.version>
5.1.49
</mysql-connector-j.version>
<druid.version>
1.1.24
</druid.version>
<pagehelper.version>
5.1.11
</pagehelper.version>
<jsqlparser.version>
3.2
</jsqlparser.version>
<mybatis.version>
3.5.4
</mybatis.version>
<mybatis-plus.version>
3.3.2
</mybatis-plus.version>
<mapstruct.version>
1.4.2.Final
</mapstruct.version>
<poi.version>
4.0.1
</poi.version>
<skipTests>
true
</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
user-config-common
</artifactId>
<version>
1.2-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
local-rnr-user-remote
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.mockito
</groupId>
<artifactId>
mockito-core
</artifactId>
<version>
4.0.0
</version>
<scope>
test
</scope>
</dependency>
<!-- mapstruct-->
<dependency>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct
</artifactId>
<version>
${mapstruct.version}
</version>
</dependency>
<!-- AOP -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-aop
</artifactId>
</dependency>
<!-- redis依赖 -->
<dependency>
<groupId>
com.cusc.component
</groupId>
<artifactId>
cache-spring
</artifactId>
<version>
1.0.4-RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.cusc.component
</groupId>
<artifactId>
cache-annotation
</artifactId>
<version>
1.0.4-RELEASE
</version>
</dependency>
<dependency>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
local-rnr-user-plug
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
local-rnr-mg-remote
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.cusc.nirvana
</groupId>
<artifactId>
local-rnr-fp-remote
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
<artifactId>
commons-beanutils
</artifactId>
<version>
1.9.4
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-resources-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
<annotationProcessorPaths>
<path>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
${lombok.version}
</version>
</path>
<path>
<groupId>
org.mapstruct
</groupId>
<artifactId>
mapstruct-processor
</artifactId>
<version>
${mapstruct.version}
</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>
src/main/java
</directory>
<includes>
<include>
**/*.xml
</include>
</includes>
<filtering>
false
</filtering>
</resource>
<resource>
<directory>
src/main/resources/
</directory>
<includes>
<include>
**/*.properties
</include>
<include>
**/*.yml
</include>
<include>
**/*.yaml
</include>
<include>
**/*.xml
</include>
<include>
**/*.factories
</include>
</includes>
<filtering>
false
</filtering>
</resource>
</resources>
</build>
</project>
src/main/java/com/cusc/nirvana/user/rnr/customer/LocalRnrCustomerApplication.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
/**
* Description: 实名customer api启动
* <br />
* CreateDate 2021-11-09 13:38:16
*
* @author yuyi
**/
@Slf4j
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
})
@ComponentScan
({
"com.cusc"
,
"com.cache.*"
})
@EnableDiscoveryClient
public
class
LocalRnrCustomerApplication
{
public
static
void
main
(
String
[]
args
)
{
try
{
ApplicationContext
context
=
SpringApplication
.
run
(
LocalRnrCustomerApplication
.
class
,
args
);
String
serverPort
=
context
.
getEnvironment
().
getProperty
(
"server.port"
);
log
.
info
(
"启动成功! Swagger2: http://127.0.0.1:"
+
serverPort
+
"/swagger-ui.html"
);
}
catch
(
Exception
ex
)
{
log
.
error
(
""
,
ex
);
}
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/CustomerConfig.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
@RefreshScope
@Data
public
class
CustomerConfig
{
@Value
(
"${rnr.tenantNo:1}"
)
private
String
tenantNo
;
@Value
(
"${rnr.allowedOrigins:}"
)
private
List
<
String
>
allowedOrigins
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/CustomerIgnoreBase64ImgJsonSerializeFilter.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
com.alibaba.fastjson.serializer.ValueFilter
;
import
com.cusc.nirvana.user.rnr.customer.constants.CustomerLogOutputConstants
;
import
com.cusc.nirvana.user.util.crypt.CryptKeyUtil
;
/**
* Description: 日志输出json序列化过滤器
* <br />
* CreateDate 2022-05-12 16:55:45
*
* @author yuyi
**/
public
class
CustomerIgnoreBase64ImgJsonSerializeFilter
implements
ValueFilter
{
@Override
public
Object
process
(
Object
object
,
String
name
,
Object
value
)
{
// 过滤base64字段的输出
if
(
CustomerLogOutputConstants
.
IGNORE_BASE64_FIELD_LIST
.
contains
(
name
))
{
return
"ignore base64 string"
;
}
//隐私数据加密
if
(
CustomerLogOutputConstants
.
ENCRYPTION_FIELD_LIST
.
contains
(
name
))
{
return
value
==
null
?
""
:
CryptKeyUtil
.
encryptToBase64
(
value
.
toString
());
}
return
value
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/EnterpriseFileHttpPoolConfig.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
/**
* Description: resttemplate的连接池配置
* <br />
* CreateDate 2022-05-18 15:00
*
* @author yuy336
**/
@Component
@Data
public
class
EnterpriseFileHttpPoolConfig
{
/**
* 设置整个连接池最大连接数
*/
@Value
(
"${httpPool.rnrBase.maxTotal:200}"
)
private
Integer
maxTotal
;
/**
* 路由是对maxTotal的细分,针对一个url的最大并发数,每路由最大连接数,默认值是2
*/
@Value
(
"${httpPool.rnrBase.defaultMaxPerRoute:100}"
)
private
Integer
defaultMaxPerRoute
;
/**
* 服务器返回数据(response)的时间,超过该时间抛出read timeout
*/
@Value
(
"${httpPool.rnrBase.socketTimeout:40000}"
)
private
Integer
socketTimeout
;
/**
* 连接上服务器(握手成功)的时间,超出该时间抛出connect timeout
*/
@Value
(
"${httpPool.rnrBase.connectTimeout:2000}"
)
private
Integer
connectTimeout
;
/**
* 从连接池中获取连接的超时时间,超过该时间未拿到可用连接,会抛出org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
*/
@Value
(
"${httpPool.rnrBase.connectionRequestTimeout:1000}"
)
private
Integer
connectionRequestTimeout
;
/**
* 线程最大空闲时间
*/
@Value
(
"${httpPool.rnrBase.maxIdleTime:10}"
)
private
Integer
maxIdleTime
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/GlobalCorsConfig.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
import
org.springframework.web.filter.CorsFilter
;
@Configuration
public
class
GlobalCorsConfig
{
@Autowired
private
CustomerConfig
customerConfig
;
@Bean
public
CorsFilter
corsFilter
()
{
CorsConfiguration
config
=
new
CorsConfiguration
();
//config.addAllowedOrigin("*");
if
(
CollectionUtils
.
isEmpty
(
config
.
getAllowedOrigins
())){
config
.
setAllowedOrigins
(
customerConfig
.
getAllowedOrigins
());
}
else
{
config
.
getAllowedOrigins
().
addAll
(
customerConfig
.
getAllowedOrigins
());
}
config
.
setAllowCredentials
(
true
);
config
.
addAllowedMethod
(
"POST"
);
config
.
addAllowedMethod
(
"OPTIONS"
);
config
.
addAllowedMethod
(
"GET"
);
config
.
addAllowedHeader
(
"*"
);
UrlBasedCorsConfigurationSource
configSource
=
new
UrlBasedCorsConfigurationSource
();
configSource
.
registerCorsConfiguration
(
"/**"
,
config
);
return
new
CorsFilter
(
configSource
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/RestTemplateRnrFileConfig.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.client.HttpClient
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.config.Registry
;
import
org.apache.http.config.RegistryBuilder
;
import
org.apache.http.conn.socket.ConnectionSocketFactory
;
import
org.apache.http.conn.socket.PlainConnectionSocketFactory
;
import
org.apache.http.conn.ssl.SSLConnectionSocketFactory
;
import
org.apache.http.impl.client.HttpClientBuilder
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.client.ClientHttpRequestFactory
;
import
org.springframework.http.client.HttpComponentsClientHttpRequestFactory
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.concurrent.TimeUnit
;
/**
* RestTemplate对象
*
* @author yubo
* @since 2022-04-18 09:54
*/
@Configuration
@Slf4j
public
class
RestTemplateRnrFileConfig
{
@Autowired
private
EnterpriseFileHttpPoolConfig
httpPoolConstants
;
@Bean
RestTemplate
nonLoadBalancedFile
()
{
return
new
RestTemplate
(
httpRequestFactoryRnrFile
());
}
private
ClientHttpRequestFactory
httpRequestFactoryRnrFile
()
{
return
new
HttpComponentsClientHttpRequestFactory
(
httpClientRnrFile
());
}
private
HttpClient
httpClientRnrFile
()
{
Registry
<
ConnectionSocketFactory
>
registry
=
RegistryBuilder
.<
ConnectionSocketFactory
>
create
()
.
register
(
"http"
,
PlainConnectionSocketFactory
.
getSocketFactory
())
.
register
(
"https"
,
SSLConnectionSocketFactory
.
getSocketFactory
())
.
build
();
PoolingHttpClientConnectionManager
connectionManager
=
new
PoolingHttpClientConnectionManager
(
registry
);
//设置整个连接池最大连接数
connectionManager
.
setMaxTotal
(
httpPoolConstants
.
getMaxTotal
());
//路由是对maxTotal的细分
connectionManager
.
setDefaultMaxPerRoute
(
httpPoolConstants
.
getDefaultMaxPerRoute
());
RequestConfig
requestConfig
=
RequestConfig
.
custom
()
.
setSocketTimeout
(
httpPoolConstants
.
getSocketTimeout
())
//返回数据的超时时间
.
setConnectTimeout
(
httpPoolConstants
.
getConnectTimeout
())
//连接上服务器的超时时间
.
setConnectionRequestTimeout
(
httpPoolConstants
.
getConnectionRequestTimeout
())
//从连接池中获取连接的超时时间
.
build
();
return
HttpClientBuilder
.
create
()
.
setDefaultRequestConfig
(
requestConfig
)
.
setConnectionManager
(
connectionManager
)
//设置后台线程剔除失效连接
.
evictExpiredConnections
().
evictIdleConnections
(
httpPoolConstants
.
getMaxIdleTime
(),
TimeUnit
.
SECONDS
)
.
build
();
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/UserRnrCustomerExceptionHandler.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.exception.CuscUserException
;
import
com.cusc.nirvana.user.rnr.fp.common.ResponseCode
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseStatus
;
/**
* Description: 异常处理
* <br />
* CreateDate 2021-11-10 10:00
*
* @author yuyi
**/
@ControllerAdvice
@Order
(
0
)
public
class
UserRnrCustomerExceptionHandler
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UserRnrCustomerExceptionHandler
.
class
);
@ExceptionHandler
(
CuscUserException
.
class
)
@ResponseBody
@ResponseStatus
(
HttpStatus
.
OK
)
public
Response
<?>
cuscUserHandler
(
CuscUserException
e
)
{
LOGGER
.
warn
(
"rnr customer Handler code: {}, msg: {}"
,
e
.
getCode
(),
e
.
getMessage
());
return
Response
.
createError
(
e
.
getMessage
(),
StringUtils
.
isBlank
(
e
.
getCode
())
?
ResponseCode
.
SYSTEM_ERROR
.
getCode
()
:
Integer
.
parseInt
(
e
.
getCode
()));
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/config/WebLogAspect.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.config
;
import
com.alibaba.fastjson.JSON
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.exception.CuscUserException
;
import
com.cusc.nirvana.user.util.CuscStringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* Description: mvc日志输出
* <br />
* CreateDate 2021-11-12 10:26
*
* @author yuyi
**/
@Aspect
@Component
public
class
WebLogAspect
{
private
final
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
WebLogAspect
.
class
);
/**
* 以 controller 包下定义的所有请求为切入点
*/
@Pointcut
(
"execution(* com.cusc.nirvana.user.rnr.customer.controller.*.*(..))"
)
public
void
webLog
()
{
}
/**
* 环绕
*
* @param proceedingJoinPoint
* @return
* @throws Throwable
*/
@Around
(
"webLog()"
)
public
Object
doAround
(
ProceedingJoinPoint
proceedingJoinPoint
)
throws
Throwable
{
long
startTime
=
System
.
currentTimeMillis
();
String
requestId
=
CuscStringUtils
.
generateUuid
();
ServletRequestAttributes
sra
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
sra
.
getRequest
();
String
url
=
request
.
getRequestURL
().
toString
();
String
method
=
request
.
getMethod
();
String
params
=
""
;
//获取请求参数集合并进行遍历拼接
if
(
HttpMethod
.
POST
.
name
().
equals
(
method
))
{
Object
[]
args
=
proceedingJoinPoint
.
getArgs
();
List
<
Object
>
filterArgsList
=
Arrays
.
stream
(
args
).
filter
(
arg
->
!(
arg
instanceof
ServletResponse
)).
collect
(
Collectors
.
toList
());
params
=
JSON
.
toJSONString
(
filterArgsList
,
new
CustomerIgnoreBase64ImgJsonSerializeFilter
());
}
else
if
(
HttpMethod
.
GET
.
name
().
equals
(
method
))
{
params
=
request
.
getQueryString
();
}
LOGGER
.
info
(
"requestId:{} , request url:{} , method:{} , params:{}"
,
requestId
,
url
,
method
,
params
);
// result的值就是被拦截方法的返回值
Object
result
=
null
;
try
{
result
=
proceedingJoinPoint
.
proceed
();
LOGGER
.
info
(
"requestId:{} , response url:{} , result:{} , cost:{} ms"
,
requestId
,
url
,
JSON
.
toJSONString
(
result
,
new
CustomerIgnoreBase64ImgJsonSerializeFilter
()),
System
.
currentTimeMillis
()
-
startTime
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"requestId:{} , response url:{} , e:{}, cost:{} ms"
,
requestId
,
url
,
e
,
System
.
currentTimeMillis
()
-
startTime
);
if
(
e
instanceof
CuscUserException
)
{
CuscUserException
cuscUserException
=
(
CuscUserException
)
e
;
result
=
Response
.
createError
(
e
.
getMessage
(),
StringUtils
.
isBlank
(
cuscUserException
.
getCode
())
?
"-1"
:
cuscUserException
.
getCode
());
}
throw
e
;
}
return
result
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/CompanyTypeEnum.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
import
com.cusc.nirvana.common.tool.url.StringUtils
;
/**
* 公司类型
*/
public
enum
CompanyTypeEnum
{
GYQY
(
0
,
"国有企业"
),
JTSYZ
(
1
,
"集体所有制"
),
SYQY
(
2
,
"私营企业"
),
YXZRGS
(
3
,
"有限责任公司"
),
GFYXGS
(
4
,
"股份有限公司"
),
YXHHQY
(
5
,
"有限合伙企业"
),
LYQY
(
6
,
"联营企业"
),
WSTZQY
(
7
,
"外商投资企业"
),
GRDZQY
(
8
,
"个人独资企业"
),
QT
(
9
,
"其他"
);
private
int
code
;
private
String
value
;
CompanyTypeEnum
(
int
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
static
CompanyTypeEnum
getEnumByCode
(
int
code
)
{
for
(
CompanyTypeEnum
item
:
CompanyTypeEnum
.
values
())
{
if
(
item
.
getCode
()
==
code
)
{
return
item
;
}
}
return
null
;
}
public
static
CompanyTypeEnum
getEnumByCode
(
String
codeStr
)
{
if
(
StringUtils
.
isBlank
(
codeStr
))
{
return
null
;
}
for
(
CompanyTypeEnum
item
:
CompanyTypeEnum
.
values
())
{
if
(
item
.
getCode
()
==
Integer
.
parseInt
(
codeStr
))
{
return
item
;
}
}
return
null
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getValue
()
{
return
value
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/CustomerConstant.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
/**
* Description: 应用常量信息
* <br />
* CreateDate 2022-01-24 16:48:59
*
* @author yuyi
**/
public
class
CustomerConstant
{
//应用id
public
static
final
String
APP_ID
=
"5"
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/CustomerLogOutputConstants.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Description: 日志输出控制常量
* <br />
* CreateDate 2022-05-12 18:58:40
*
* @author yuyi
**/
public
class
CustomerLogOutputConstants
{
/**
* base64属性字段名称
*/
public
static
final
List
<
String
>
IGNORE_BASE64_FIELD_LIST
=
new
ArrayList
<
String
>()
{{
add
(
"base64"
);
add
(
"file"
);
add
(
"facePicBase64"
);
add
(
"nationalEmblemPicBase64"
);
add
(
"videoBase64"
);
add
(
"faceImg"
);
add
(
"baseImg"
);
add
(
"ocrPic"
);
add
(
"bestFrameList"
);
}};
/**
* 隐私属性加密字段名称
*/
public
static
final
List
<
String
>
ENCRYPTION_FIELD_LIST
=
new
ArrayList
<
String
>()
{{
add
(
"fullName"
);
add
(
"certNumber"
);
add
(
"certAddress"
);
add
(
"contactAddress"
);
add
(
"phone"
);
add
(
"email"
);
add
(
"companyName"
);
add
(
"companyCertNumber"
);
add
(
"companyCertAddress"
);
add
(
"companyContactAddress"
);
add
(
"liaisonName"
);
add
(
"liaisonCertNumber"
);
add
(
"liaisonCertAddress"
);
add
(
"liaisonContactAddress"
);
add
(
"liaisonPhone"
);
add
(
"iccid"
);
add
(
"iotId"
);
add
(
"vin"
);
}};
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/CustomerTypeEnum.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
/**
* 客户类型
*
* @author jk
* @date
*/
public
enum
CustomerTypeEnum
{
/**
* 新车车主
*/
NEW_CAR_OWNER
(
0
,
"新车车主"
),
/**
* 二手车车主
*/
USED_CAR_OWNER
(
1
,
"二手车新车主"
);
private
int
code
;
private
String
name
;
CustomerTypeEnum
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
CustomerTypeEnum
getEnumByCode
(
int
code
)
{
for
(
CustomerTypeEnum
e
:
CustomerTypeEnum
.
values
())
{
if
(
e
.
getCode
()
==
code
)
{
return
e
;
}
}
return
null
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/FIleSystemType.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
import
com.cusc.nirvana.user.exception.CuscUserException
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.Arrays
;
@AllArgsConstructor
@Getter
public
enum
FIleSystemType
{
MINIO
(
"minio"
,
"MINIO"
),
OSS
(
"oss"
,
"OSS"
),
;
private
String
code
;
private
String
descprition
;
public
static
FIleSystemType
getBytype
(
String
code
)
{
return
Arrays
.
stream
(
FIleSystemType
.
values
())
.
filter
(
businessDetail
->
businessDetail
.
getCode
().
equals
(
code
))
.
findFirst
()
.
orElseThrow
(()
->
new
CuscUserException
(
""
,
"未查询到对应的文件系统类型:"
+
code
));
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/IdentifyConstants.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
/**
* @author yubo
* @since 2022-04-19 13:56
*/
public
class
IdentifyConstants
{
//身份证校验规则
public
static
final
String
ID_CARD_REGEX
=
"(^\\d{15}$)|(^\\d{17}([0-9]|X|x)$)"
;
//港澳通行证校验规则
public
static
final
String
HK_MACAU_REGEX
=
"^[H|M][0-9]{10}$"
;
//台湾同行证校验规则
public
static
final
String
HK_TAIWAN_CITIZEN_REGEX
=
"^([0-9]|[a-z]|[A-Z]){10}$"
;
//手机校验规则
public
static
final
String
PHONE_REGEX
=
"[0-9]{11}"
;
//男性
public
static
final
String
GENDER_MALE
=
"0"
;
//女性
public
static
final
String
GENDER_FEMALE
=
"1"
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/IndustryTypeEnum.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
import
org.apache.commons.lang3.StringUtils
;
/**
* 行业类型
*/
public
enum
IndustryTypeEnum
{
blmy
(
0
,
"农、林、牧、渔业"
),
cky
(
1
,
"采矿业"
),
zzy
(
2
,
"制造业"
),
dlrlrqjsschgyy
(
3
,
"电力、热力、燃气及水生产和供应业"
),
jzy
(
4
,
"建筑业"
),
pfhlsy
(
5
,
"批发和零售业"
),
jtyscchyzy
(
6
,
"交通运输、仓储和邮政业"
),
zshcyy
(
7
,
"住宿和餐饮业"
),
xxcsrjhxxjsfwy
(
8
,
"信息传输、软件和信息技术服务业"
),
jry
(
9
,
"金融业"
),
fdcy
(
10
,
"房地产业"
),
zlhswfwy
(
11
,
"租赁和商务服务业"
),
kxyjhjsfwy
(
12
,
"科学研究和技术服务业"
),
sl_hjhggssgly
(
13
,
"水利、环境和公共设施管理业"
),
jmfw_xlhqtfwy
(
14
,
"居民服务、修理和其他服务业"
),
jy
(
15
,
"教育"
),
wshshgz
(
16
,
"卫生和社会工作"
),
wh_tyhyly
(
17
,
"文化、体育和娱乐业"
),
gggl_shbzhshzz
(
18
,
"公共管理、社会保障和社会组织"
),
gjzz
(
19
,
"国际组织"
),
qt
(
20
,
"其他"
),
;
private
int
code
;
private
String
value
;
IndustryTypeEnum
(
int
code
,
String
value
)
{
this
.
code
=
code
;
this
.
value
=
value
;
}
public
static
IndustryTypeEnum
getEnumByCode
(
int
code
)
{
for
(
IndustryTypeEnum
item
:
IndustryTypeEnum
.
values
())
{
if
(
item
.
getCode
()
==
code
)
{
return
item
;
}
}
return
null
;
}
public
static
IndustryTypeEnum
getEnumByCode
(
String
codeStr
)
{
if
(
StringUtils
.
isBlank
(
codeStr
))
{
return
null
;
}
for
(
IndustryTypeEnum
item
:
IndustryTypeEnum
.
values
())
{
if
(
item
.
getCode
()
==
Integer
.
parseInt
(
codeStr
))
{
return
item
;
}
}
return
null
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getValue
()
{
return
value
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/ResponseCode.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
public
enum
ResponseCode
{
USER_SUBJECT_INVALID
(
1701
,
"用户主体信息无效"
),
COMPANY_UUID_INVALID
(
1702
,
"项目关联的公司信息无效"
),
USER_INVALID
(
1703
,
"用户信息无效"
),
SUBJECT_CUSTOMER_INFO_INVALID
(
1704
,
"主体实名信息无效"
),
USER_PHONE_REPEAT
(
1705
,
"用户手机号重复"
),
SUBJECT_CUSTOMER_INFO_NOT_FOUND
(
1706
,
"未找到主体实名信息"
),
ENCRYPT_FAIL
(
1707
,
"加密失败"
),
DECRYPT_FAIL
(
1708
,
"解密失败"
),
REPEAT_REQUEST_FAIL
(
1709
,
"请勿重复提交"
),
RNR_INFO_INVALID
(
1710
,
"实名信息无效"
),
SMS_CAPTCHA_INVALID
(
1711
,
"短信验证码无效"
),
ICCID_INVALID
(
1712
,
"ICCID无效"
),
RNR_PHONE_NOT_FOUND
(
1713
,
"手机号未找到"
),
IMG_CAPTCHA_INVALID
(
1714
,
"图形验证码无效"
),
INVALID_DATA
(
1001
,
"数据校验不通过"
),
SYS_BUSY
(
1002
,
"服务调用失败"
),
SERVICE_NOT_FOUND
(
1003
,
"服务不存在"
),
TP_SYS_BUSY
(
1004
,
"第三方服务调用失败"
),
JSON_FORMAT_ERROR
(
1005
,
"参数格式错误"
),
REQ_TOO_MANY_TIMES
(
1007
,
"请求过于频繁,请稍后再试!"
),
NO_DATA_AUTH
(
1008
,
"服务,请稍后再试!"
),
PARAMETER_NOT_NULL
(
1009
,
"参数不能为空!"
),
REAL_BY_SELF_FALSE
(
1010
,
"不允许补录"
),
NO_EFFECTIVE_TIME
(
1011
,
"不在服务时间"
)
;
private
Integer
code
;
private
String
msg
;
ResponseCode
(
Integer
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/RnrBizzTypeEnum.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
/**
* @className: RnrBizzTypeEnum
* @description:
* @author: jk
* @date: 2022/6/8 15:54
* @version: 1.0
**/
public
enum
RnrBizzTypeEnum
{
Bind
(
1
,
"实名"
),
Unbound
(
2
,
"解绑"
),
ChangeBinding
(
3
,
"换件"
),
INFO_CHANGE
(
4
,
"信息变更"
),
REPEAT_BIND
(
5
,
"重绑"
);
private
int
code
;
private
String
comment
;
RnrBizzTypeEnum
(
int
code
,
String
comment
)
{
this
.
code
=
code
;
this
.
comment
=
comment
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getComment
()
{
return
comment
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/RnrStatusEnum.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
/**
* @author: jk
* @description: 实名状态
* @date: 2022/6/8 16:20
* @version: 1.0
*/
public
enum
RnrStatusEnum
{
INIT
(
0
,
"未实名/初始化"
),
RNR
(
1
,
"已实名"
),
RNR_FAIL
(
2
,
"实名失败"
),
UNBOUND
(
3
,
"已解绑"
);
private
int
code
;
private
String
comment
;
RnrStatusEnum
(
int
code
,
String
comment
)
{
this
.
code
=
code
;
this
.
comment
=
comment
;
}
public
static
RnrStatusEnum
getEnumByCode
(
int
code
)
{
for
(
RnrStatusEnum
sys
:
RnrStatusEnum
.
values
())
{
if
(
sys
.
getCode
()
==
code
)
{
return
sys
;
}
}
return
null
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getComment
()
{
return
comment
;
}
}
Prev
1
2
3
4
5
6
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment