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-enterprise
Commits
c997214d
Commit
c997214d
authored
Jun 17, 2025
by
kang.nie@inzymeits.com
Browse files
初始化代码
parent
741c2feb
Pipeline
#3107
failed with stages
in 0 seconds
Changes
265
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/cusc/nirvana/user/rnr/enterprise/config/UserRnrEnterpriseExceptionHandler.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.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
UserRnrEnterpriseExceptionHandler
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
UserRnrEnterpriseExceptionHandler
.
class
);
@ExceptionHandler
(
CuscUserException
.
class
)
@ResponseBody
@ResponseStatus
(
HttpStatus
.
OK
)
public
Response
<?>
cuscUserHandler
(
CuscUserException
e
)
{
LOGGER
.
warn
(
"cuscUserHandler 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/enterprise/config/WebLogAspect.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.config
;
import
com.alibaba.fastjson.JSON
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.authentication.plug.user.UserSubjectUtil
;
import
com.cusc.nirvana.user.exception.CuscUserException
;
import
com.cusc.nirvana.user.rnr.enterprise.common.DesensitizationFieId
;
import
com.cusc.nirvana.user.rnr.enterprise.common.EnterpriseIgnoreBase64ImgJsonSerializeFilter
;
import
com.cusc.nirvana.user.rnr.enterprise.util.DesensitizationUtil
;
import
com.cusc.nirvana.user.rnr.fp.client.FpUserOperationLogClient
;
import
com.cusc.nirvana.user.rnr.fp.dto.FpUserOperationLogDTO
;
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.aspectj.lang.reflect.MethodSignature
;
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.annotation.Resource
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.concurrent.ThreadPoolExecutor
;
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
);
@Resource
private
FpUserOperationLogClient
logClient
;
private
static
final
String
IP_UNKOWN
=
"unknown"
;
@Resource
private
ThreadPoolExecutor
logThreadPool
;
/**
* 以 controller 包下定义的所有请求为切入点
*/
@Pointcut
(
"execution(* com.cusc.nirvana.user.rnr.enterprise.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
EnterpriseIgnoreBase64ImgJsonSerializeFilter
());
}
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
EnterpriseIgnoreBase64ImgJsonSerializeFilter
()),
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
;
}
finally
{
MethodSignature
methodSignature
=
(
MethodSignature
)
proceedingJoinPoint
.
getSignature
();
Method
method1
=
methodSignature
.
getMethod
();
SysLog
sysLog
=
method1
.
getAnnotation
(
SysLog
.
class
);
if
(
null
!=
sysLog
)
{
//记录日志
saveLog
(
sysLog
,
request
,
params
,
result
,
proceedingJoinPoint
,
UserSubjectUtil
.
getUserId
(),
UserSubjectUtil
.
getTenantNo
(),
UserSubjectUtil
.
getOrganId
());
}
}
return
result
;
}
private
void
saveLog
(
SysLog
sysLog
,
HttpServletRequest
request
,
String
params
,
Object
result
,
ProceedingJoinPoint
proceedingJoinPoint
,
String
userId
,
String
tenantNo
,
String
orgId
)
{
logThreadPool
.
submit
(()
->
{
try
{
FpUserOperationLogDTO
logDto
=
new
FpUserOperationLogDTO
();
logDto
.
setUuid
(
CuscStringUtils
.
generateUuid
());
logDto
.
setOptModule
(
sysLog
.
sysModule
().
getSysModule
());
logDto
.
setOptAction
(
sysLog
.
sysModule
().
getSysAction
());
logDto
.
setRequestIp
(
getClientIp
(
request
));
logDto
.
setRequestParameter
(
params
);
logDto
.
setRequestUrl
(
request
.
getRequestURL
().
toString
());
logDto
.
setCreator
(
userId
);
logDto
.
setTenantNo
(
tenantNo
);
logDto
.
setOrgId
(
orgId
);
if
(
result
instanceof
Response
){
Response
response
=
(
Response
)
result
;
logDto
.
setResponseCode
(
String
.
valueOf
(
response
.
getCode
()));
logDto
.
setResponseMsg
(
response
.
getMsg
());
}
String
optContent
=
sysLog
.
sysModule
().
getOptContent
();
if
(
StringUtils
.
isNotBlank
(
optContent
)){
List
<
String
>
desensitizeContent
=
new
ArrayList
<>();
Object
[]
args
=
proceedingJoinPoint
.
getArgs
();
for
(
Object
arg:
args
){
Field
[]
fields
=
arg
.
getClass
().
getDeclaredFields
();
for
(
Field
field:
fields
){
DesensitizationFieId
annotation
=
field
.
getDeclaredAnnotation
(
DesensitizationFieId
.
class
);
if
(
null
!=
annotation
)
{
try
{
field
.
setAccessible
(
true
);
Object
o
=
field
.
get
(
arg
);
String
content
=
o
instanceof
String
?
(
String
)
o:
JSON
.
toJSONString
(
o
);
desensitizeContent
.
add
(
annotation
.
sort
(),
DesensitizationUtil
.
desensitizeByRule
(
annotation
.
desensitizationRule
(),
content
));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取属性值失败"
);
}
}
}
}
logDto
.
setOptContent
(
String
.
format
(
optContent
,
desensitizeContent
.
toArray
()));
}
logClient
.
add
(
logDto
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"saveLog has error"
,
e
);
}
});
}
private
static
String
getClientIp
(
HttpServletRequest
request
)
{
String
ip
=
request
.
getHeader
(
"x-forwarded-for"
);
if
(
StringUtils
.
isBlank
(
ip
)
||
""
.
equals
(
ip
.
trim
())
||
IP_UNKOWN
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getHeader
(
"Proxy-Client-IP"
);
}
if
(
StringUtils
.
isBlank
(
ip
)
||
""
.
equals
(
ip
.
trim
())
||
IP_UNKOWN
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getHeader
(
"WL-Proxy-Client-IP"
);
}
if
(
StringUtils
.
isBlank
(
ip
)
||
""
.
equals
(
ip
.
trim
())
||
IP_UNKOWN
.
equalsIgnoreCase
(
ip
))
{
ip
=
request
.
getRemoteAddr
();
}
if
(
StringUtils
.
isBlank
(
ip
))
{
return
""
;
}
// 多个路由时,取第一个非unknown的ip
final
String
[]
arr
=
ip
.
split
(
","
);
for
(
final
String
str
:
arr
)
{
if
(!
IP_UNKOWN
.
equalsIgnoreCase
(
str
))
{
ip
=
str
;
break
;
}
}
return
ip
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/CheckChangeAdminEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
import
lombok.Data
;
/**
* @className: checkChangAdmin
* @description: TODO
* @author: fxh
* @date: 2022/5/30 9:25
* @version: 1.0
**/
public
enum
CheckChangeAdminEnum
{
NEW_ADMIN_USER_ID
(
1000
,
"新管理员id不可为空"
),
CREATE_ADMIN_ACCOUNT
(
1001
,
"新建管理员账号不可为空"
),
CREATE_ADMIN_NAME
(
1002
,
"新建管理员姓名不可为空"
),
CREATE_ADMIN_PASSWORD
(
1003
,
"新建管理员密码不可为空"
),
CREATE_ADMIN_PHONE
(
1004
,
"新建管理员手机号不可为空"
);
private
Integer
code
;
private
String
msg
;
CheckChangeAdminEnum
(
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/enterprise/constants/CompanyTypeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
public
enum
CompanyTypeEnum
{
/**
* 企业
*/
ENTERPRISE
(
"ENTERPRISE"
,
"企业"
),
/**
* 车企
*/
AUTOMOBILE_ENTERPRISE
(
"AUTOMOBILE_ENTERPRISE"
,
"车企"
);
private
String
code
;
private
String
name
;
CompanyTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
CompanyTypeEnum
getEnumByCode
(
String
code
)
{
for
(
CompanyTypeEnum
sys
:
CompanyTypeEnum
.
values
())
{
if
(
sys
.
getCode
().
equals
(
code
))
{
return
sys
;
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/CustomerTypeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* 客户类型
*
* @author huchenhui
* @date 2022-04-15
*/
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/enterprise/constants/EnterpriseLogOutputConstants.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Description: 日志输出控制常量
* <br />
* CreateDate 2022-05-12 18:58:40
*
* @author yuyi
**/
public
class
EnterpriseLogOutputConstants
{
/**
* base64属性字段名称
*/
public
static
final
List
<
String
>
IGNORE_BASE64_FIELD_LIST
=
new
ArrayList
<
String
>()
{{
add
(
"base64"
);
add
(
"file"
);
}};
/**
* 隐私属性加密字段名称
*/
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/enterprise/constants/EnterpriseLoginSourceEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.Arrays
;
/**
* Description: 应用常量信息
* <br />
* CreateDate 2022-01-24 16:48:59
*
* @author yuyi
**/
@AllArgsConstructor
@Getter
public
enum
EnterpriseLoginSourceEnum
{
/**
* WEB
*/
WEB
(
"WEB"
,
"4"
),
/**
* H5
*/
H5
(
"H5"
,
"7"
);
/**
* 平台来源
*/
private
String
platformSource
;
/**
* appId
*/
private
String
appId
;
public
static
EnterpriseLoginSourceEnum
getByPlatform
(
String
platformSource
){
return
Arrays
.
stream
(
EnterpriseLoginSourceEnum
.
values
())
.
filter
(
e
->
e
.
getPlatformSource
().
equals
(
platformSource
)).
findFirst
()
.
orElse
(
EnterpriseLoginSourceEnum
.
WEB
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/FIleSystemType.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.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/enterprise/constants/FileMouldEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: FileMouldEnum
* @description: TODO
* @author: fxh
* @date: 2022/6/2 15:00
* @version: 1.0
**/
public
enum
FileMouldEnum
{
/**
* 车厂
*/
people_Mould_Url
(
0
,
"个人入网协议模板"
,
"peopleMouldUrl"
),
/**
* 经销商
*/
company_Mould_Url
(
1
,
"公司入网协议模板"
,
"companyMouldUrl"
),
/**
*
*/
real_name_Mould_Url
(
2
,
"实名制责任告知书模板"
,
"realnameMouldUrl"
),
/**
*
*/
authorize_Mould_Url
(
3
,
"企业授权书模板"
,
"authorizeMouldUrl"
),
/**
*
*/
other_Mould_Url
(
4
,
"其它模板"
,
"otherMouldUrl"
);
private
int
code
;
private
String
name
;
private
String
msg
;
FileMouldEnum
(
int
code
,
String
name
,
String
msg
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
msg
=
msg
;
}
public
static
FileMouldEnum
getFileMouldCode
(
int
code
)
{
for
(
FileMouldEnum
e
:
FileMouldEnum
.
values
())
{
if
(
e
.
getCode
()
==
code
)
{
return
e
;
}
}
return
null
;
}
public
static
FileMouldEnum
[]
getFileMouldMap
()
{
return
FileMouldEnum
.
values
();
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
public
String
getMsg
()
{
return
msg
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/FuelTypeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: FuelTypeEnum
* @description: 燃料种类
* @author: jk
* @date: 2022/6/29 9:39
* @version: 1.0
**/
public
enum
FuelTypeEnum
{
GASOLINE
(
"1"
,
"汽油"
),
DIESEL_OIL
(
"2"
,
"柴油"
),
ELECTRIC
(
"3"
,
"电"
),
MIXED_OIL
(
"4"
,
"混合油"
),
NATURAL_GAS
(
"5"
,
"天然气"
),
LIQUEFIED_PETROLEUM_GAS
(
"6"
,
"液化石油气"
),
METHANOL
(
"7"
,
"甲醇"
),
ETHANOL
(
"8"
,
"乙醇"
),
SOLAR_ENERGY
(
"9"
,
"太阳能"
),
HYDROGEN
(
"10"
,
"氢"
),
HYBRID
(
"11"
,
"混合动力"
);
private
String
code
;
private
String
name
;
FuelTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
FuelTypeEnum
getEnumByCode
(
String
code
)
{
for
(
FuelTypeEnum
e
:
FuelTypeEnum
.
values
())
{
if
(
e
.
getCode
().
equals
(
code
))
{
return
e
;
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/IdentifyConstants.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.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/enterprise/constants/OrdinaryAdminEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* Description: 普通管理员类型
* <br />
* CreateDate 2022-05-19 19:43:58
*
* @author yuyi
**/
public
enum
OrdinaryAdminEnum
{
CAR_FACTORY
(
0
,
"车厂"
),
/**
* 经销商
*/
DISTRIBUTOR
(
1
,
"经销商管理员"
),
/**
* 组织
*/
ORGAN
(
2
,
"组织管理员"
);
private
int
code
;
private
String
name
;
OrdinaryAdminEnum
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
OrdinaryAdminEnum
getEnumByCode
(
int
code
)
{
for
(
OrdinaryAdminEnum
e
:
OrdinaryAdminEnum
.
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/enterprise/constants/OrganBizzTypeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* Description: 普通管理员类型
* <br />
* CreateDate 2022-05-19 19:43:58
*
* @author yuyi
**/
public
enum
OrganBizzTypeEnum
{
/**
* 车厂
*/
CAR_FACTORY
(
1
,
"车厂"
),
/**
* 经销商
*/
DISTRIBUTOR
(
2
,
"经销商"
),
/**
*
*/
SON_ORGAN
(
3
,
"车企子组织"
);
private
int
code
;
private
String
name
;
OrganBizzTypeEnum
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
OrganBizzTypeEnum
getEnumByCode
(
int
code
)
{
for
(
OrganBizzTypeEnum
e
:
OrganBizzTypeEnum
.
values
())
{
if
(
e
.
getCode
()
==
code
)
{
return
e
;
}
}
return
null
;
}
public
static
OrganBizzTypeEnum
[]
getEnumByCodeMap
()
{
return
OrganBizzTypeEnum
.
values
();
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/PlaceOfOriginOfVehicleEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: PlaceOfOriginOfVehicleEnum
* @description: 车辆产地枚举类
* @author: jk
* @date: 2022/6/29 9:35
* @version: 1.0
**/
public
enum
PlaceOfOriginOfVehicleEnum
{
DOMESTIC
(
"1"
,
"国产"
),
IMPORT
(
"2"
,
"进口"
);
private
String
code
;
private
String
name
;
PlaceOfOriginOfVehicleEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
PlaceOfOriginOfVehicleEnum
getEnumByCode
(
String
code
)
{
for
(
PlaceOfOriginOfVehicleEnum
e
:
PlaceOfOriginOfVehicleEnum
.
values
())
{
if
(
e
.
getCode
().
equals
(
code
))
{
return
e
;
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/ResponseCode.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* Description: 响应码
* <br />
* CreateDate 2021-11-02 19:52:36
*
* @author yuyi
**/
public
enum
ResponseCode
{
USER_PHONE_EXISTS
(
2000
,
"用户手机号码已存在"
),
USER_ORGAN_NOT_FOUND
(
2001
,
"未查询到当前用户组织id"
),
CAPTCHA_IMAGE_CODE_ERROR
(
2002
,
"图形验证码错误"
),
USER_PHONE_NOT_FOUND
(
2003
,
"您输入的手机号无法获取到有效的用户信息"
),
USER_PASSWORD_KEY_NOT_FOUND
(
2004
,
"请先获取密码的加密密钥"
),
USER_NAME_PASSWORD_ERROR
(
2005
,
"账号或密码错误"
),
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
,
"请求过于频繁,请稍后再试!"
),
REDIS_OPT_FAIL
(
1009
,
"redis操作失败,请稍后再试!"
),
PARAMETER_NULL
(
1010
,
"请求参数不能为空!"
),
DATA_NULL
(
1011
,
"没有获取到当前管理员!"
),
PROTOCOL_MANAGE_NULL
(
1012
,
"没有获取到协议信息"
),
UUID_NULL
(
1013
,
"uuid不可为空"
),
ProtocolManage_NOT_NULL
(
1014
,
"当前组织已经添加过了"
),
BIZTYPE_ERROR
(
1015
,
"当前组织为经销商不可以创建除经销商以外的组织类型"
),
RNR_INFO_IS_NULL
(
1016
,
"未查询到用户信息"
),
RNR_ORDER_IS_NULL
(
1017
,
"未查询到订单信息"
),
RNR_CAR_INFO_IS_NULL
(
1018
,
"未查询到实名卡信息"
)
;
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/enterprise/constants/RnrStatusEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: RnrStatusEnum
* @description: 实名状态
* @author: jk
* @date: 2022/6/16 19:26
* @version: 1.0
**/
public
enum
RnrStatusEnum
{
/**
* 车厂
*/
NO_REAL_NAME
(
0
,
"未实名"
),
REAL_NAME
(
1
,
"已实名"
),
REAL_NAME_ERROR
(
2
,
"实名失败"
),
/**
* 经销商
*/
UN_BIND
(
3
,
"已解绑"
);
private
Integer
code
;
private
String
name
;
RnrStatusEnum
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
RnrStatusEnum
getEnumByCode
(
Integer
code
)
{
for
(
RnrStatusEnum
e
:
RnrStatusEnum
.
values
())
{
if
(
e
.
getCode
().
equals
(
code
))
{
return
e
;
}
}
return
null
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/RoleTyeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: RoleTyeEnum
* @description: TODO
* @author: fxh
* @date: 2022/5/27 9:36
* @version: 1.0
**/
public
enum
RoleTyeEnum
{
/**
* 车厂
*/
CAR_FACTORY
(
"101"
,
"车厂或者车企子组织"
),
SON_FACTORY
(
"103"
,
"子组织"
),
UPDATE_CAR_FACTORY
(
"102"
,
"车厂或者车企子组织管理员降级"
),
/**
* 经销商
*/
DISTRIBUTOR
(
"201"
,
"经销商"
),
UPDATE_DISTRIBUTOR
(
"202"
,
"经销商管理员降级"
);
private
String
code
;
private
String
name
;
RoleTyeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
RoleTyeEnum
getEnumByCode
(
String
code
)
{
for
(
RoleTyeEnum
e
:
RoleTyeEnum
.
values
())
{
if
(
e
.
getCode
().
equals
(
code
))
{
return
e
;
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/SignConstants.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* 签名静态属性
*/
public
class
SignConstants
{
/**应用ID的key名称*/
public
final
static
String
APP_ID
=
"APPID"
;
/**随机数key*/
public
final
static
String
NONCE_STR
=
"NONCE_STR"
;
/**时间戳key*/
public
final
static
String
TIMESTAMP
=
"TIMESTAMP"
;
/**版本key*/
public
final
static
String
VERSION
=
"VERSION"
;
/**签名key*/
public
final
static
String
SIGN
=
"SIGN"
;
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/VehicleChannelTypeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: VehicleChannelType
* @description: 渠道类型
* @author: jk
* @date: 2022/6/29 9:46
* @version: 1.0
**/
public
enum
VehicleChannelTypeEnum
{
PHYSICAL_CHANNEL
(
"1"
,
"实体渠道"
),
PERSONNEL_ISIT
(
"2"
,
"人员上门"
),
ELECTRONIC_CHANNEL
(
"3"
,
"电子渠道"
);
private
String
code
;
private
String
name
;
VehicleChannelTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
VehicleChannelTypeEnum
getEnumByCode
(
String
code
)
{
for
(
VehicleChannelTypeEnum
e
:
VehicleChannelTypeEnum
.
values
())
{
if
(
e
.
getCode
().
equals
(
code
))
{
return
e
;
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/enterprise/constants/VehicleTypeEnum.java
0 → 100644
View file @
c997214d
package
com.cusc.nirvana.user.rnr.enterprise.constants
;
/**
* @className: VehicleTypeEnum
* @description: 车辆类型
* @author: jk
* @date: 2022/6/29 9:22
* @version: 1.0
**/
public
enum
VehicleTypeEnum
{
BUS
(
"1"
,
"乘用车及客车"
),
TRUCK
(
"2"
,
"货车"
),
TRACTOR
(
"3"
,
"半挂车牵引车"
),
SEMI_TRAILER
(
"4"
,
"半挂车"
),
TWO_WHEELED_MOTORCYCLE
(
"5"
,
"两轮摩托车和两轮轻便摩托车"
),
THREE_WHEELED_MOTORCYCLE
(
"6"
,
"三轮摩托车和三轮轻便摩托车"
),
TRICYCLE
(
"7"
,
"三轮汽车"
),
LOW_SPEED_TRUCK
(
"8"
,
"低速货车"
),
SPECIAL_PURPOSE_VEHICLE
(
"9"
,
"专用汽车"
),
OTHER
(
"10"
,
"示非《公告》车辆产品"
);
private
String
code
;
private
String
name
;
VehicleTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
VehicleTypeEnum
getEnumByCode
(
String
code
)
{
for
(
VehicleTypeEnum
e
:
VehicleTypeEnum
.
values
())
{
if
(
e
.
getCode
().
equals
(
code
))
{
return
e
;
}
}
return
null
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
Prev
1
2
3
4
5
6
…
14
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