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
Show whitespace changes
Inline
Side-by-side
src/main/java/com/cusc/nirvana/user/rnr/customer/constants/SmsConfigConstant.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.constants
;
/**
* Description: 短信配置相关常量类
* <br />
* CreateDate 2022-01-28 11:25:10
*
* @author yuyi
**/
public
class
SmsConfigConstant
{
//验证码的推送策略Code
public
static
final
String
SMS_STRATEGY_CODE
=
"verification_code_sync_strategy"
;
//验证码的短信模板Code
public
static
final
String
SMS_TEMPLATE_CODE
=
"verification_code_template_code"
;
//验证码过期时间 秒
public
static
final
int
SMS_CAPTCHA_EXPIRE_TIME
=
1800
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/BaseConfigController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.authentication.plug.user.UserSubjectUtil
;
import
com.cusc.nirvana.user.rnr.customer.service.IBaseConfigService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* Description: 卡解绑控制层
* <br />
* CreateDate 2022-04-16 15:16:55
*
* @author yuyi
**/
@RestController
@RequestMapping
(
"/baseconfig"
)
public
class
BaseConfigController
{
@Autowired
private
IBaseConfigService
baseConfigService
;
@ApiOperation
(
value
=
"获取字典数据"
,
notes
=
"获取字典数据"
)
@GetMapping
(
"/getDicData"
)
public
Response
getDicData
()
{
String
tenantNo
=
UserSubjectUtil
.
getTenantNo
();
return
baseConfigService
.
getDicData
(
tenantNo
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/CuscImageController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.authentication.plug.user.UserSubjectUtil
;
import
com.cusc.nirvana.user.rnr.customer.service.IFileService
;
import
com.cusc.nirvana.user.rnr.fp.client.FileSystemClient
;
import
com.cusc.nirvana.user.rnr.fp.dto.FileDownloadDTO
;
import
com.cusc.nirvana.user.rnr.fp.dto.FileUploadDTO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 图片处理
* 图片处理放到user-rnr-fp中
*/
@RestController
@RequestMapping
(
"/cuscImage"
)
public
class
CuscImageController
{
@Autowired
private
FileSystemClient
fileSystemClient
;
@Autowired
private
IFileService
fileService
;
@PostMapping
(
"/upload"
)
public
Response
upload
(
FileUploadDTO
fileUploadDTO
)
{
// //直接调用文件系统,可以参考com服务的文件上传
// fileUploadDTO.setType("public");
// if (StringUtils.isBlank(fileUploadDTO.getUserId())) {
// fileUploadDTO.setUserId(UserSubjectUtil.getTenantNo());//水印使用
// }
// return fileSystemClient.uploadImage(fileUploadDTO);
//文件大小必须大于0
if
(
fileUploadDTO
.
getFile
().
getSize
()
<
1
)
{
return
Response
.
createError
(
"文件内容不能为空"
);
}
return
fileService
.
upload
(
fileUploadDTO
);
}
/**
* 文件下载
*
* @param fileDownloadDTO
* @return
*/
@PostMapping
(
"/viewBase64"
)
public
Response
viewBase64
(
@RequestBody
FileDownloadDTO
fileDownloadDTO
)
{
if
(
fileDownloadDTO
==
null
||
StringUtils
.
isBlank
(
fileDownloadDTO
.
getUuid
()))
{
Response
.
createError
(
"参数uuid为空"
);
}
return
fileSystemClient
.
getBase64
(
fileDownloadDTO
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/EnterpriseH5Controller.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.dto.EnterpriseH5CallBackRespDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.EnterpriseH5RequestDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.EnterpriseH5RespDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.LivenessCallbackReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.service.IEnterpriseH5Service
;
import
com.cusc.nirvana.user.rnr.customer.service.ValidationService
;
import
com.cusc.nirvana.user.rnr.customer.util.ValidationUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
/**
* @className: EnterpriseH5Controller
* @description: 车主企业实名
* @author: jk
* @date: 2022/6/8 9:17
* @version: 1.0
**/
@RestController
@RequestMapping
(
"/enterprise/h5"
)
public
class
EnterpriseH5Controller
{
@Resource
private
IEnterpriseH5Service
enterpriseH5Service
;
@Resource
private
ValidationService
validationService
;
@PostMapping
(
"/submitRnr"
)
public
Response
<
EnterpriseH5RespDTO
>
submitRnr
(
@Valid
@RequestBody
EnterpriseH5RequestDTO
dto
)
{
Response
response
=
validationService
.
checkEffectiveTime
();
if
(!
response
.
isSuccess
()){
return
response
;
}
return
Response
.
createSuccess
(
enterpriseH5Service
.
submitRnrH5
(
dto
));
}
@RequestMapping
(
value
=
"/livenessCallback"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Response
<
EnterpriseH5CallBackRespDTO
>
afreshLivenessUrl
(
@Valid
@RequestBody
LivenessCallbackReqDTO
bean
)
{
return
Response
.
createSuccess
(
enterpriseH5Service
.
afreshLivenessUrl
(
bean
));
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/FileController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.dto.FileDownloadDTO
;
import
com.cusc.nirvana.user.rnr.customer.service.IFileService
;
import
com.cusc.nirvana.user.rnr.fp.client.FileSystemClient
;
import
com.cusc.nirvana.user.rnr.fp.dto.FileRecordDTO
;
import
com.cusc.nirvana.user.rnr.fp.dto.FileUploadDTO
;
import
com.cusc.nirvana.user.rnr.fp.dto.ImageBase64DTO
;
import
com.cusc.nirvana.web.exception.AppGlobalException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.util.Base64
;
/**
* @author stayAnd
* @date 2022/4/12
*/
@Slf4j
@RestController
@RequestMapping
(
"/file"
)
public
class
FileController
{
@Autowired
private
IFileService
fileService
;
@Resource
private
FileSystemClient
fileSystemClient
;
@PostMapping
(
"/upload"
)
public
Response
<
FileRecordDTO
>
upload
(
FileUploadDTO
fileUploadDTO
){
//直接调用文件系统,将公有改为私有
// fileUploadDTO.setType("private");
// if (StringUtils.isBlank(fileUploadDTO.getUserId())) {
// fileUploadDTO.setUserId(UserSubjectUtil.getUserId());
// }
// return fileService.upload(fileUploadDTO);
//文件大小必须大于0
if
(
fileUploadDTO
.
getFile
().
getSize
()
<
1
)
{
return
Response
.
createError
(
"文件内容不能为空"
);
}
return
fileService
.
uploadTwo
(
fileUploadDTO
);
}
/**
* 文件下载
* @param fileDownloadDTO
* @return
*/
// @PostMapping("/download")
// public Response download(HttpServletResponse response, @RequestBody FileDownloadDTO fileDownloadDTO) {
// OutputStream outputStream = null;
// InputStream inputStream = null;
// File file = null;
// try {
// /*file = fileService.downloadToLocal(fileDownloadDTO);
// response.getOutputStream().write();
// if(file == null){
// throw new Exception("文件不存在");
// }
// inputStream = new FileInputStream(file);
// // 以文件形式下载
// response.setHeader("Content-Disposition",
// "attachment;filename=" + URLEncoder.encode(StringUtils.isNotEmpty(fileDownloadDTO.getFileName()) ? fileDownloadDTO.getFileName() : "文件.xlsx", "utf-8"));
// response.setHeader("Access-Control-Expose-Headers","Content-Disposition");
//
// BufferedInputStream in = new BufferedInputStream(inputStream);
// outputStream = new BufferedOutputStream(response.getOutputStream());
// byte[] car = new byte[1024];
// int len;
// while ((len = in.read(car)) != -1) {
// outputStream.write(car, 0, len);
// }
// outputStream.flush();*/
//
// response.setHeader("Content-Disposition",
// "attachment;filename=" + URLEncoder.encode(StringUtils.isNotEmpty(fileDownloadDTO.getFileName()) ? fileDownloadDTO.getFileName() : "文件.xlsx", "utf-8"));
// response.setHeader("Access-Control-Expose-Headers","Content-Disposition");
// response.getOutputStream().write(fileService.downloadToByteArray(fileDownloadDTO));
// } catch (Exception e) {
// throw new AppGlobalException("下载失败", e);
// } finally {
// /*IOUtils.closeQuietly(inputStream);
// IOUtils.closeQuietly(outputStream);
// if (file != null && file.exists() && file.isFile()) {
// file.delete();
// }*/
// try {
// response.getOutputStream().close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
//
// return Response.createSuccess();
// }
/**
* 下载接口
* @param response
* @param fileDownloadDTO
* @return
*/
@PostMapping
(
"/download"
)
public
Response
download
(
HttpServletResponse
response
,
@RequestBody
FileDownloadDTO
fileDownloadDTO
)
{
try
{
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
StringUtils
.
isNotEmpty
(
fileDownloadDTO
.
getFileName
())
?
fileDownloadDTO
.
getFileName
()
:
"文件.xlsx"
,
"utf-8"
));
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
byte
[]
result
=
null
;
try
{
log
.
info
(
"下载文件-开始, uuid : {}"
,
fileDownloadDTO
.
getUuid
());
com
.
cusc
.
nirvana
.
user
.
rnr
.
fp
.
dto
.
FileDownloadDTO
dto
=
new
com
.
cusc
.
nirvana
.
user
.
rnr
.
fp
.
dto
.
FileDownloadDTO
();
dto
.
setUuid
(
fileDownloadDTO
.
getUuid
());
Response
<
ImageBase64DTO
>
base64Response
=
fileSystemClient
.
getBase64
(
dto
);
String
base64
=
base64Response
.
getData
().
getBase64
();
result
=
Base64
.
getDecoder
().
decode
(
base64
);
log
.
info
(
"下载文件-结束, uuid : {}"
,
fileDownloadDTO
.
getUuid
());
}
catch
(
Exception
e
)
{
log
.
error
(
"getImageBase64 error: {}"
,
e
.
getMessage
(),
e
);
return
Response
.
createError
(
e
.
getMessage
());
}
//InputStream fileStream = MinIOUtils.getObject(minIOConfig.getBucketName(), fileDownloadDTO.getUuid());
response
.
getOutputStream
().
write
(
result
);
}
catch
(
Exception
e
)
{
throw
new
AppGlobalException
(
"下载失败"
,
e
);
}
finally
{
try
{
if
(
response
.
getOutputStream
()
!=
null
)
{
response
.
getOutputStream
().
close
();
}
}
catch
(
IOException
e
)
{
log
.
error
(
"---response.getOutputStream().close()--exception--"
,
e
);
}
}
return
Response
.
createSuccess
();
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/LocalVerifyController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.authentication.plug.user.UserSubjectUtil
;
import
com.cusc.nirvana.user.rnr.fp.client.FpRnrClient
;
import
com.cusc.nirvana.user.rnr.mg.client.LocalVerifyClient
;
import
com.cusc.nirvana.user.rnr.mg.dto.*
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"/localverify"
)
@Slf4j
public
class
LocalVerifyController
{
@Autowired
private
LocalVerifyClient
localVerifyClient
;
@Autowired
private
FpRnrClient
fpRnrClient
;
/**
* 本地人工审核列表
*/
@ApiOperation
(
value
=
"本地人工审核列表"
,
notes
=
"本地人工审核列表"
)
@PostMapping
(
"/list"
)
public
Response
list
(
@RequestBody
LocalVerifyListRqDTO
rq
)
{
return
localVerifyClient
.
list
(
rq
);
}
/**
* 查询工单企业详情
*
* @return 单条数据
*/
@ApiOperation
(
value
=
"查询工单企业详情"
,
notes
=
"查询工单企业详情"
)
@PostMapping
(
"/getEnterpriseDetail"
)
public
Response
<
EnterpriseVerifyDetailDTO
>
getEnterpriseDetail
(
@RequestBody
RnrOrderDTO
rnrOrderDTO
)
{
rnrOrderDTO
.
setUserId
(
UserSubjectUtil
.
getUserId
());
rnrOrderDTO
.
setApplicationId
(
UserSubjectUtil
.
getAppId
());
rnrOrderDTO
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
return
Response
.
createSuccess
(
localVerifyClient
.
getEnterpriseDetail
(
rnrOrderDTO
));
}
/**
* 企业负责人变更审核详情
* @return 单条数据
*/
@ApiOperation
(
value
=
"企业负责人变更审核详情"
,
notes
=
"企业负责人变更审核详情"
)
@PostMapping
(
"/enterpriseRnrPersonDetail"
)
public
Response
<
CompanyCorporationChangeRespDTO
>
enterpriseRnrPersonDetail
(
@RequestParam
RnrOrderDTO
dto
)
{
return
Response
.
createSuccess
(
localVerifyClient
.
enterpriseRnrPersonDetail
(
dto
.
getUuid
()));
}
/**
* 自然人审核详情
*/
@ApiOperation
(
value
=
"自然人审核详情"
,
notes
=
"自然人审核详情"
)
@PostMapping
(
"/personDetail"
)
public
Response
personDetail
(
@RequestBody
LocalVerifyListRqDTO
rq
)
{
rq
.
setUserId
(
UserSubjectUtil
.
getUserId
());
rq
.
setApplicationId
(
UserSubjectUtil
.
getAppId
());
rq
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
return
localVerifyClient
.
personDetail
(
rq
);
}
/**
* 提交
*/
@ApiOperation
(
value
=
"提交审核"
,
notes
=
"提交审核"
)
@PostMapping
(
"/submit"
)
public
Response
submit
(
@RequestBody
LocalVerifySubmitRq
rq
)
{
rq
.
setUserId
(
UserSubjectUtil
.
getUserId
());
return
localVerifyClient
.
submit
(
rq
);
}
/**
* 重试按钮
*/
@ApiOperation
(
value
=
"重试按钮"
,
notes
=
"重试"
)
@PostMapping
(
"/retry"
)
public
Response
retry
(
@RequestBody
LocalVerifySubmitRq
rq
)
{
Response
<
RnrRelationDTO
>
response
=
localVerifyClient
.
retry
(
rq
);
RnrRelationDTO
bean
=
response
.
getData
();
log
.
info
(
"mg retry return:"
+
JSONObject
.
toJSONString
(
bean
));
return
fpRnrClient
.
personalInfoOnlyRnr
(
bean
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/LoginController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.client.CaptchaClient
;
import
com.cusc.nirvana.user.auth.client.CiamLoginClient
;
import
com.cusc.nirvana.user.auth.client.LoginClient
;
import
com.cusc.nirvana.user.auth.common.constants.CaptchaTypeEnum
;
import
com.cusc.nirvana.user.auth.common.constants.UserTypeEnum
;
import
com.cusc.nirvana.user.auth.identification.dto.CaptchaCreateReq
;
import
com.cusc.nirvana.user.auth.identification.dto.CaptchaCreateResp
;
import
com.cusc.nirvana.user.auth.identification.dto.MobileLoginReq
;
import
com.cusc.nirvana.user.auth.identification.dto.Oauth2Token
;
import
com.cusc.nirvana.user.auth.identification.dto.SmsSendConfig
;
import
com.cusc.nirvana.user.exception.CuscUserException
;
import
com.cusc.nirvana.user.rnr.customer.config.CustomerConfig
;
import
com.cusc.nirvana.user.rnr.customer.constants.CustomerConstant
;
import
com.cusc.nirvana.user.rnr.customer.constants.SmsConfigConstant
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrLoginReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.util.ValidationUtil
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* Description: c端客户登录控制层
* <br />
* CreateDate 2022-04-24 17:30:21
*
* @author yuyi
**/
@RestController
@RequestMapping
(
"/login"
)
@ApiModel
(
"B端用户登录相关(车企、经销商)"
)
@Slf4j
public
class
LoginController
{
@Autowired
private
LoginClient
loginClient
;
@Autowired
private
CiamLoginClient
ciamLoginClient
;
@Autowired
private
CaptchaClient
captchaClient
;
@Autowired
private
CustomerConfig
customerConfig
;
@GetMapping
(
"/getGraphic"
)
@ApiOperation
(
"获取图片验证码"
)
public
Response
<
CaptchaCreateResp
>
getGraphic
()
{
CaptchaCreateReq
req
=
new
CaptchaCreateReq
();
req
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
req
.
setCaptchaHeight
(
40
);
req
.
setCaptchaWidth
(
90
);
req
.
setCaptchaType
(
CaptchaTypeEnum
.
TYPE_DEFAULT
);
req
.
setCaptchaLength
(
4
);
Response
<
CaptchaCreateResp
>
response
=
captchaClient
.
simpleGraphic
(
req
);
if
(
null
==
response
||
!
response
.
isSuccess
()
||
null
==
response
.
getData
())
{
return
Response
.
createError
(
response
.
getMsg
(),
response
.
getCode
());
}
return
Response
.
createSuccess
(
response
.
getData
());
}
@PostMapping
(
"/getSms"
)
@ApiOperation
(
"获取短信验证码"
)
public
Response
getSms
(
@RequestBody
MobileLoginReq
bean
)
{
//检查手机
Response
checkPhone
=
ValidationUtil
.
checkPhone
(
bean
.
getPhone
());
if
(!
checkPhone
.
isSuccess
())
{
throw
new
CuscUserException
(
checkPhone
.
getCode
(),
checkPhone
.
getMsg
());
}
bean
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
bean
.
setCheckCaptchaImg
(
true
);
bean
.
setCaptchaExpire
(
SmsConfigConstant
.
SMS_CAPTCHA_EXPIRE_TIME
);
SmsSendConfig
smsConfig
=
new
SmsSendConfig
();
smsConfig
.
setStrategyCode
(
SmsConfigConstant
.
SMS_STRATEGY_CODE
);
smsConfig
.
setSmsTemplateCode
(
SmsConfigConstant
.
SMS_TEMPLATE_CODE
);
bean
.
setSmsSendConfig
(
smsConfig
);
bean
.
setUserType
(
UserTypeEnum
.
CIAM
.
getCode
());
log
.
info
(
"getSms request = {}"
,
JSONObject
.
toJSONString
(
bean
));
bean
.
setTenantNo
(
customerConfig
.
getTenantNo
());
return
loginClient
.
sendSmsCaptcha
(
bean
);
}
@PostMapping
(
"/getSmsH5"
)
@ApiOperation
(
"获取短信验证码"
)
public
Response
getSmsH5
(
@RequestBody
MobileLoginReq
bean
)
{
//检查手机
Response
checkPhone
=
ValidationUtil
.
checkPhone
(
bean
.
getPhone
());
if
(!
checkPhone
.
isSuccess
())
{
throw
new
CuscUserException
(
checkPhone
.
getCode
(),
checkPhone
.
getMsg
());
}
bean
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
bean
.
setCheckCaptchaImg
(
true
);
bean
.
setCaptchaExpire
(
SmsConfigConstant
.
SMS_CAPTCHA_EXPIRE_TIME
);
SmsSendConfig
smsConfig
=
new
SmsSendConfig
();
smsConfig
.
setStrategyCode
(
SmsConfigConstant
.
SMS_STRATEGY_CODE
);
smsConfig
.
setSmsTemplateCode
(
SmsConfigConstant
.
SMS_TEMPLATE_CODE
);
bean
.
setSmsSendConfig
(
smsConfig
);
bean
.
setUserType
(
UserTypeEnum
.
CIAM
.
getCode
());
//允许没注册校验
bean
.
setLoginType
(
"allow"
);
log
.
info
(
"getSms request = {}"
,
JSONObject
.
toJSONString
(
bean
));
bean
.
setTenantNo
(
customerConfig
.
getTenantNo
());
return
loginClient
.
sendSmsCaptchaNew
(
bean
);
}
@PostMapping
(
"/ciam"
)
@ApiOperation
(
"登录"
)
public
Response
<
Oauth2Token
>
login
(
@RequestBody
RnrLoginReqDTO
bean
)
{
//检查手机
Response
checkPhone
=
ValidationUtil
.
checkPhone
(
bean
.
getPhone
());
if
(!
checkPhone
.
isSuccess
())
{
throw
new
CuscUserException
(
checkPhone
.
getCode
(),
checkPhone
.
getMsg
());
}
MobileLoginReq
mobileLogin
=
new
MobileLoginReq
();
mobileLogin
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
mobileLogin
.
setPhone
(
bean
.
getPhone
());
mobileLogin
.
setCaptcha
(
bean
.
getSms
());
mobileLogin
.
setTenantNo
(
customerConfig
.
getTenantNo
());
mobileLogin
.
setUserType
(
UserTypeEnum
.
CIAM
.
getCode
());
return
ciamLoginClient
.
mobileLogin
(
mobileLogin
);
}
/**
* 小鹏汽车登录接口
* @param bean
* @return
*/
@PostMapping
(
"/ciamXP"
)
@ApiOperation
(
"登录"
)
public
Response
<
Oauth2Token
>
loginXP
(
@RequestBody
RnrLoginReqDTO
bean
)
{
log
.
info
(
"ciamXP reqStr:"
+
JSONObject
.
toJSONString
(
bean
));
MobileLoginReq
mobileLogin
=
new
MobileLoginReq
();
mobileLogin
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
mobileLogin
.
setPhone
(
bean
.
getPhone
());
mobileLogin
.
setTenantNo
(
customerConfig
.
getTenantNo
());
mobileLogin
.
setUserType
(
UserTypeEnum
.
CIAM
.
getCode
());
log
.
info
(
"mobileLoginXP reqStr:"
+
JSONObject
.
toJSONString
(
mobileLogin
));
return
ciamLoginClient
.
mobileLoginXP
(
mobileLogin
);
}
@PostMapping
(
"/userLoginAdd"
)
@ApiOperation
(
"注册登录"
)
public
Response
<
Oauth2Token
>
userLoginAdd
(
@RequestBody
RnrLoginReqDTO
bean
)
{
//检查手机
Response
checkPhone
=
ValidationUtil
.
checkPhone
(
bean
.
getPhone
());
if
(!
checkPhone
.
isSuccess
())
{
throw
new
CuscUserException
(
checkPhone
.
getCode
(),
checkPhone
.
getMsg
());
}
MobileLoginReq
mobileLogin
=
new
MobileLoginReq
();
mobileLogin
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
mobileLogin
.
setPhone
(
bean
.
getPhone
());
mobileLogin
.
setCaptcha
(
bean
.
getSms
());
// mobileLogin.setTenantNo(bean.getTenantNo());
mobileLogin
.
setTenantNo
(
customerConfig
.
getTenantNo
());
mobileLogin
.
setUserType
(
UserTypeEnum
.
CIAM
.
getCode
());
return
ciamLoginClient
.
userLoginAdd
(
mobileLogin
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/LogoutController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.client.LogoutClient
;
import
com.cusc.nirvana.user.auth.common.dto.LogoutDTO
;
import
com.cusc.nirvana.user.rnr.customer.constants.CustomerConstant
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* Description: C端用户退出
* <br />
* CreateDate 2022-04-24 17:30:21
*
* @author yuyi
**/
@RestController
@ApiModel
(
"C端用户退出"
)
public
class
LogoutController
{
@Autowired
private
LogoutClient
logoutClient
;
@PostMapping
(
"/logout"
)
@ApiOperation
(
value
=
"退出"
,
notes
=
"退出"
)
public
Response
logout
(
@RequestHeader
(
"Authorization"
)
String
accessToken
)
{
if
(
StringUtils
.
isEmpty
(
accessToken
))
{
return
Response
.
createError
(
"请在header中传递token"
);
}
accessToken
=
accessToken
.
replaceAll
(
"bearer "
,
""
);
LogoutDTO
bean
=
new
LogoutDTO
();
bean
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
bean
.
setAccessToken
(
accessToken
);
return
logoutClient
.
logout
(
bean
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/NewVinCardController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.service.INewVinCardService
;
import
com.cusc.nirvana.user.rnr.fp.dto.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
/**
* @author stayAnd
* @date 2022/5/16
*/
@RestController
@RequestMapping
(
"/newVinCard"
)
public
class
NewVinCardController
{
@Resource
private
INewVinCardService
vinCardService
;
@RequestMapping
(
"/queryUnBindCardByVin"
)
public
Response
<
VinCardResultDTO
>
queryUnBindCardByVin
(
@RequestBody
VinCardQueryDTO
queryDTO
){
return
vinCardService
.
queryUnBindCardByVin
(
queryDTO
);
}
@RequestMapping
(
"/checkVinCard"
)
public
Response
<
VinCardCheckResultDTO
>
checkVinCard
(
@RequestBody
VinCardCheckDTO
vinCardCheckDTO
){
return
Response
.
createSuccess
(
vinCardService
.
checkVinCard
(
vinCardCheckDTO
));
}
@PostMapping
(
"/checkVin"
)
public
Response
<
VinCheckResultDTO
>
checkVin
(
@RequestBody
VinCheckRequestDTO
requestDTO
){
return
Response
.
createSuccess
(
vinCardService
.
checkVin
(
requestDTO
));
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/OcrController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.constants.ResponseCode
;
import
com.cusc.nirvana.user.rnr.fp.client.OcrClient
;
import
com.cusc.nirvana.user.rnr.fp.dto.OcrNpReqDTO
;
import
com.cusc.nirvana.user.rnr.fp.dto.OcrNpRespDTO
;
import
com.cusc.nirvana.user.util.CuscStringUtils
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 光伏识别控制层
*
* @author yuy336
* @since 2022-01-26 11:17:21
*/
@RestController
@RequestMapping
(
"/ocr"
)
public
class
OcrController
{
@Autowired
OcrClient
ocrClient
;
/**
* 自然人身份证光符识别
*
* @param bean 筛选条件
* @return 查询结果
*/
@PostMapping
(
"/idCard"
)
@ApiOperation
(
value
=
"自然人身份证光符识别"
,
notes
=
"自然人身份证光符识别"
)
public
Response
<
OcrNpRespDTO
>
idCard
(
@RequestBody
OcrNpReqDTO
bean
)
{
if
(
CuscStringUtils
.
isEmpty
(
bean
.
getOcrPic
()))
{
return
Response
.
createError
(
ResponseCode
.
PARAMETER_NOT_NULL
.
getMsg
(),
ResponseCode
.
PARAMETER_NOT_NULL
.
getCode
());
}
bean
.
setSerialNumber
(
CuscStringUtils
.
generateUuid
());
return
ocrClient
.
ocr
(
bean
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/PersonalH5Controller.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.dto.LivenessCallbackReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.PersonalH5CallBackRespDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.PersonalH5ReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.PersonalH5RespDTO
;
import
com.cusc.nirvana.user.rnr.customer.service.IPersonalH5Service
;
import
com.cusc.nirvana.user.rnr.customer.service.ValidationService
;
import
com.cusc.nirvana.user.rnr.customer.util.ValidationUtil
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
* @className: PersonalH5Controller
* @description: 车主H5
* @author: jk
* @date: 2022/6/7 11:03
* @version: 1.0
**/
@RestController
@RequestMapping
(
"/personal/h5"
)
public
class
PersonalH5Controller
{
@Resource
private
IPersonalH5Service
personalH5Service
;
@Resource
private
ValidationService
validationService
;
/**
* h5自然人实名认证
*/
@ApiOperation
(
value
=
"提交自然人实名认证"
,
notes
=
"提交自然人实名认证"
)
@PostMapping
(
"/submitRnr"
)
public
Response
<
PersonalH5RespDTO
>
submitRnr
(
@Valid
@RequestBody
PersonalH5ReqDTO
bean
)
{
Response
response
=
validationService
.
checkEffectiveTime
();
if
(!
response
.
isSuccess
()){
return
response
;
}
return
Response
.
createSuccess
(
personalH5Service
.
submitRnrH5
(
bean
));
}
/**
* 活体检测结果回调
*/
@ApiOperation
(
value
=
"活体检测结果回调"
,
notes
=
"活体检测结果回调"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"操作成功返回数据类型"
,
response
=
Response
.
class
)})
@RequestMapping
(
value
=
"/livenessCallback"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Response
<
PersonalH5CallBackRespDTO
>
afreshLivenessUrl
(
@Valid
@RequestBody
LivenessCallbackReqDTO
bean
)
{
return
Response
.
createSuccess
(
personalH5Service
.
afreshLivenessUrl
(
bean
));
}
@ApiOperation
(
value
=
"校验是否在有效时间内"
,
notes
=
"校验是否在有效时间内"
)
@RequestMapping
(
value
=
"/checkEffectiveTime"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
Response
checkEffectiveTime
()
{
Response
response
=
validationService
.
checkEffectiveTime
();
if
(!
response
.
isSuccess
()){
return
response
;
}
return
response
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/ProtocolManageController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.dto.ProtocolManageDTO
;
import
com.cusc.nirvana.user.rnr.customer.service.IProtocolManageService
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @className: ProtocolManageController
* @description: 协议
* @author: jk
* @date: 2022/6/10 13:35
* @version: 1.0
**/
@RestController
@RequestMapping
(
"/protocolManage/customer/"
)
@Slf4j
public
class
ProtocolManageController
{
@Autowired
private
IProtocolManageService
protocolManageService
;
@ApiOperation
(
"查询协议"
)
@PostMapping
(
"/query"
)
public
Response
<
List
<
ProtocolManageDTO
>>
query
(){
return
protocolManageService
.
query
();
}
@ApiOperation
(
"查询logo"
)
@GetMapping
(
"/noLogin"
)
public
Response
<
List
<
ProtocolManageDTO
>>
noLogin
(){
return
protocolManageService
.
noLogin
();
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/RnrRecordController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.PageResult
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.auth.authentication.plug.user.UserSubjectUtil
;
import
com.cusc.nirvana.user.auth.client.CaptchaClient
;
import
com.cusc.nirvana.user.auth.identification.dto.CaptchaVerificationReq
;
import
com.cusc.nirvana.user.rnr.customer.constants.CustomerConstant
;
import
com.cusc.nirvana.user.rnr.customer.constants.ResponseCode
;
import
com.cusc.nirvana.user.rnr.customer.converter.RnrRecordConverter
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrInfoReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrInfoRespDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrRecordPageReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrRecordRespDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrSmsReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrUnboundReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.service.ISmsService
;
import
com.cusc.nirvana.user.rnr.fp.dto.SmsRequestDTO
;
import
com.cusc.nirvana.user.rnr.mg.client.MgRnrCardInfoClient
;
import
com.cusc.nirvana.user.rnr.mg.client.MgRnrInfoClient
;
import
com.cusc.nirvana.user.rnr.mg.client.MgRnrUnboundClient
;
import
com.cusc.nirvana.user.rnr.mg.constants.IsBatchEnum
;
import
com.cusc.nirvana.user.rnr.mg.constants.RnrBizzTypeEnum
;
import
com.cusc.nirvana.user.rnr.mg.constants.RnrOrderAuditTypeEnum
;
import
com.cusc.nirvana.user.rnr.mg.constants.RnrOrderSourceEnum
;
import
com.cusc.nirvana.user.rnr.mg.constants.RnrOrderStatusEnum
;
import
com.cusc.nirvana.user.rnr.mg.constants.RnrOrderType
;
import
com.cusc.nirvana.user.rnr.mg.dto.MgRnrCardInfoDTO
;
import
com.cusc.nirvana.user.rnr.mg.dto.MgRnrInfoDTO
;
import
com.cusc.nirvana.user.rnr.mg.dto.RnrOrderDTO
;
import
com.cusc.nirvana.user.rnr.mg.dto.VehicleUnbindDTO
;
import
com.cusc.nirvana.user.util.CuscStringUtils
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* Description: C端用户实名记录
* <br />
* CreateDate 2022-04-24 17:34:24
*
* @author yuyi
**/
@Slf4j
@RestController
@RequestMapping
(
"/rnr"
)
public
class
RnrRecordController
{
@Autowired
private
MgRnrCardInfoClient
rnrCardInfoClient
;
@Autowired
private
MgRnrInfoClient
rnrInfoClient
;
@Autowired
private
MgRnrUnboundClient
unboundClient
;
@Autowired
private
ISmsService
smsService
;
@Autowired
private
CaptchaClient
captchaClient
;
@PostMapping
(
"/record"
)
@ApiOperation
(
value
=
"实名认证记录"
,
notes
=
"实名认证记录"
)
public
Response
<
PageResult
<
RnrRecordRespDTO
>>
record
(
@RequestBody
RnrRecordPageReqDTO
bean
)
{
//通过用户id分页查询
MgRnrCardInfoDTO
card
=
new
MgRnrCardInfoDTO
();
card
.
setCurrPage
(
bean
.
getCurrPage
());
card
.
setPageSize
(
bean
.
getPageSize
());
card
.
setUserId
(
UserSubjectUtil
.
getUserId
());
card
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
card
.
setRnrBizzType
(
RnrBizzTypeEnum
.
Bind
.
getCode
());
Response
<
PageResult
<
MgRnrCardInfoDTO
>>
cardResp
=
rnrCardInfoClient
.
queryPageByUserId
(
card
);
if
(
cardResp
!=
null
&&
cardResp
.
isSuccess
())
{
PageResult
<
MgRnrCardInfoDTO
>
cardPage
=
cardResp
.
getData
();
PageResult
<
RnrRecordRespDTO
>
ret
;
if
(!
CollectionUtils
.
isEmpty
(
cardPage
.
getList
()))
{
List
<
RnrRecordRespDTO
>
dataList
=
RnrRecordConverter
.
INSTANCE
.
cardListToRnrRecordList
(
cardPage
.
getList
());
ret
=
new
PageResult
(
dataList
,
cardPage
.
getTotalCount
(),
cardPage
.
getPageSize
(),
cardPage
.
getCurrPage
());
}
else
{
ret
=
new
PageResult
(
new
ArrayList
(),
cardPage
.
getTotalCount
(),
cardPage
.
getPageSize
(),
cardPage
.
getCurrPage
());
}
return
Response
.
createSuccess
(
ret
);
}
return
Response
.
createSuccess
(
new
PageResult
<>(
bean
.
getCurrPage
(),
bean
.
getPageSize
()));
}
@PostMapping
(
"/rnrInfo"
)
@ApiOperation
(
value
=
"实名记录查询"
,
notes
=
"实名记录查询"
)
public
Response
<
RnrInfoRespDTO
>
rnrInfo
(
@RequestBody
RnrInfoReqDTO
bean
)
{
if
(
CuscStringUtils
.
isEmpty
(
bean
.
getRnrId
()))
{
return
Response
.
createError
(
ResponseCode
.
PARAMETER_NOT_NULL
.
getMsg
(),
ResponseCode
.
PARAMETER_NOT_NULL
.
getCode
());
}
MgRnrInfoDTO
info
=
new
MgRnrInfoDTO
();
info
.
setUuid
(
bean
.
getRnrId
());
info
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
Response
<
MgRnrInfoDTO
>
infoResp
=
rnrInfoClient
.
getByUuid
(
info
);
RnrInfoRespDTO
ret
=
null
;
if
(
infoResp
!=
null
&&
infoResp
.
isSuccess
())
{
ret
=
RnrRecordConverter
.
INSTANCE
.
rnrInfoToViewInfo
(
infoResp
.
getData
());
}
return
Response
.
createSuccess
(
ret
);
}
@PostMapping
(
"/unboundSms"
)
@ApiOperation
(
value
=
"实名解绑短信"
,
notes
=
"实名解绑短信"
)
public
Response
unboundSms
(
@RequestBody
RnrSmsReqDTO
bean
)
{
if
(
CuscStringUtils
.
isEmpty
(
bean
.
getRnrId
()))
{
return
Response
.
createError
(
ResponseCode
.
PARAMETER_NOT_NULL
.
getMsg
(),
ResponseCode
.
PARAMETER_NOT_NULL
.
getCode
());
}
//验证图形验证码
CaptchaVerificationReq
captchaVerificationReq
=
new
CaptchaVerificationReq
();
captchaVerificationReq
.
setApplicationId
(
CustomerConstant
.
APP_ID
);
captchaVerificationReq
.
setCaptchaValue
(
bean
.
getImgCaptcha
());
captchaVerificationReq
.
setRequestId
(
bean
.
getRequestId
());
captchaVerificationReq
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
Response
<
Boolean
>
captchaResp
=
captchaClient
.
verificationCaptcha
(
captchaVerificationReq
);
if
(
captchaResp
==
null
||
!
captchaResp
.
isSuccess
()
||
!
captchaResp
.
getData
())
{
return
Response
.
createError
(
ResponseCode
.
IMG_CAPTCHA_INVALID
.
getMsg
(),
ResponseCode
.
IMG_CAPTCHA_INVALID
.
getCode
());
}
MgRnrInfoDTO
info
=
new
MgRnrInfoDTO
();
info
.
setUuid
(
bean
.
getRnrId
());
info
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
Response
<
MgRnrInfoDTO
>
infoResp
=
rnrInfoClient
.
getByUuid
(
info
);
if
(
infoResp
!=
null
&&
infoResp
.
isSuccess
()
&&
CuscStringUtils
.
isNotEmpty
(
infoResp
.
getData
().
getPhone
()))
{
SmsRequestDTO
smsReq
=
new
SmsRequestDTO
();
smsReq
.
setBizType
(
"rnr"
);
smsReq
.
setPhone
(
infoResp
.
getData
().
getPhone
());
smsService
.
sendSmsRnr
(
smsReq
);
return
Response
.
createSuccess
();
}
return
Response
.
createError
(
ResponseCode
.
RNR_PHONE_NOT_FOUND
.
getMsg
(),
ResponseCode
.
RNR_PHONE_NOT_FOUND
.
getCode
());
}
@PostMapping
(
"/unbound"
)
@ApiOperation
(
value
=
"实名解绑"
,
notes
=
"实名解绑"
)
public
Response
unbound
(
@RequestBody
RnrUnboundReqDTO
bean
)
{
if
(
CuscStringUtils
.
isEmpty
(
bean
.
getRnrId
())
||
CuscStringUtils
.
isEmpty
(
bean
.
getIccid
()))
{
return
Response
.
createError
(
ResponseCode
.
PARAMETER_NOT_NULL
.
getMsg
(),
ResponseCode
.
PARAMETER_NOT_NULL
.
getCode
());
}
//查询手机号
MgRnrInfoDTO
info
=
new
MgRnrInfoDTO
();
info
.
setUuid
(
bean
.
getRnrId
());
info
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
Response
<
MgRnrInfoDTO
>
infoResp
=
rnrInfoClient
.
getByUuid
(
info
);
if
(
infoResp
==
null
||
!
infoResp
.
isSuccess
()
||
infoResp
.
getData
()
==
null
||
CuscStringUtils
.
isEmpty
(
infoResp
.
getData
().
getPhone
()))
{
return
Response
.
createError
(
ResponseCode
.
RNR_INFO_INVALID
.
getMsg
(),
ResponseCode
.
RNR_INFO_INVALID
.
getCode
());
}
info
=
infoResp
.
getData
();
// //检查短信验证码是否正确
// SmsRequestDTO sms = new SmsRequestDTO();
// sms.setBizType("rnr");
// sms.setCaptcha(bean.getSmsCaptcha());
// sms.setPhone(info.getPhone());
// Response smsResp = smsService.checkSmsCaptcha(sms);
// if (smsResp == null) {
// return Response.createError(ResponseCode.SMS_CAPTCHA_INVALID.getMsg(),
// ResponseCode.SMS_CAPTCHA_INVALID.getCode());
// }
// if (!smsResp.isSuccess()) {
// return Response.createError(smsResp.getMsg(), smsResp.getCode());
// }
//验证卡的状态
MgRnrCardInfoDTO
card
=
new
MgRnrCardInfoDTO
();
card
.
setIccid
(
bean
.
getIccid
());
card
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
Response
<
MgRnrCardInfoDTO
>
cardResp
=
rnrCardInfoClient
.
getOneByIccid
(
card
);
if
(
cardResp
==
null
||
!
cardResp
.
isSuccess
()
||
cardResp
.
getData
()
==
null
)
{
return
Response
.
createError
(
ResponseCode
.
ICCID_INVALID
.
getMsg
(),
ResponseCode
.
ICCID_INVALID
.
getCode
());
}
//判断输入的rnrid 和 iccid查询出来的 rnrId是否一致
if
(!
cardResp
.
getData
().
getRnrId
().
equals
(
bean
.
getRnrId
()))
{
return
Response
.
createError
(
ResponseCode
.
INVALID_DATA
.
getMsg
(),
ResponseCode
.
INVALID_DATA
.
getCode
());
}
//解绑
VehicleUnbindDTO
unbind
=
new
VehicleUnbindDTO
();
unbind
.
setTenantNo
(
UserSubjectUtil
.
getTenantNo
());
unbind
.
setIsTrust
(
0
);
unbind
.
setIsSecondHandCar
(
0
);
info
.
setSerial_number
(
CuscStringUtils
.
generateUuid
());
info
.
setUuid
(
CuscStringUtils
.
generateUuid
());
info
.
setRnrBizzType
(
RnrBizzTypeEnum
.
Unbound
.
getCode
());
unbind
.
setInfo
(
info
);
unbind
.
setOrder
(
createOrderInfo
(
info
));
unbind
.
setCardList
(
createCardInfo
(
info
,
unbind
.
getOrder
().
getUuid
(),
cardResp
.
getData
().
getIotId
(),
cardResp
.
getData
().
getIccid
()));
unbind
.
setCardIds
(
Arrays
.
asList
(
cardResp
.
getData
().
getUuid
()));
unbind
.
setRnrIds
(
Arrays
.
asList
(
cardResp
.
getData
().
getRnrId
()));
return
unboundClient
.
batchUnbound
(
unbind
);
}
//获取实名工单信息
private
RnrOrderDTO
createOrderInfo
(
MgRnrInfoDTO
info
)
{
RnrOrderDTO
rnrOrderDTO
=
new
RnrOrderDTO
();
rnrOrderDTO
.
setRnrBizzType
(
RnrBizzTypeEnum
.
Unbound
.
getCode
());
rnrOrderDTO
.
setOrderType
(
RnrOrderType
.
UNBIND
.
getCode
());
rnrOrderDTO
.
setRnrId
(
info
.
getUuid
());
rnrOrderDTO
.
setUuid
(
CuscStringUtils
.
generateUuid
());
rnrOrderDTO
.
setTenantNo
(
info
.
getTenantNo
());
rnrOrderDTO
.
setOperator
(
UserSubjectUtil
.
getUserId
());
rnrOrderDTO
.
setCreator
(
UserSubjectUtil
.
getUserId
());
rnrOrderDTO
.
setOrderSource
(
RnrOrderSourceEnum
.
H5_CUSTOMER
.
getCode
());
rnrOrderDTO
.
setSerialNumber
(
info
.
getSerial_number
());
rnrOrderDTO
.
setOrderStatus
(
RnrOrderStatusEnum
.
PASS
.
getCode
());
rnrOrderDTO
.
setAutoRnr
(
true
);
rnrOrderDTO
.
setAuditType
(
RnrOrderAuditTypeEnum
.
AUTO
.
getCode
());
rnrOrderDTO
.
setSendWorkOrder
(
false
);
rnrOrderDTO
.
setIsBatchOrder
(
IsBatchEnum
.
NO_BATCH
.
getCode
());
return
rnrOrderDTO
;
}
//获取车卡信息
private
List
<
MgRnrCardInfoDTO
>
createCardInfo
(
MgRnrInfoDTO
info
,
String
orderId
,
String
iotId
,
String
iccid
)
{
List
<
MgRnrCardInfoDTO
>
retList
=
new
ArrayList
<>();
MgRnrCardInfoDTO
card
=
new
MgRnrCardInfoDTO
();
card
.
setRnrBizzType
(
RnrBizzTypeEnum
.
Unbound
.
getCode
());
card
.
setIccid
(
iccid
);
card
.
setIotId
(
iotId
);
card
.
setRnrId
(
info
.
getUuid
());
card
.
setOrderId
(
orderId
);
card
.
setCreator
(
UserSubjectUtil
.
getUserId
());
card
.
setSerial_number
(
info
.
getSerial_number
());
card
.
setUuid
(
CuscStringUtils
.
generateUuid
());
card
.
setTenantNo
(
info
.
getTenantNo
());
retList
.
add
(
card
);
return
retList
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/controller/SmsController.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.controller
;
import
com.cusc.nirvana.common.result.Response
;
import
com.cusc.nirvana.user.rnr.customer.service.ISmsService
;
import
com.cusc.nirvana.user.rnr.fp.dto.SmsRequestDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author stayAnd
* @date 2022/4/12
*/
@RestController
@RequestMapping
(
"/sms"
)
public
class
SmsController
{
@Autowired
private
ISmsService
smsService
;
@PostMapping
(
"/sendSmsRnr"
)
public
Response
sendSmsRnr
(
@RequestBody
SmsRequestDTO
bean
)
{
return
smsService
.
sendSmsRnr
(
bean
);
}
@PostMapping
(
"/checkSms"
)
public
Response
checkSms
(
@RequestBody
SmsRequestDTO
bean
)
{
return
smsService
.
checkSmsCaptcha
(
bean
);
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/converter/PersonalRequestConvert.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.converter
;
import
com.cusc.nirvana.user.rnr.customer.dto.PersonalH5ReqDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.PersonalRequestDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.SecondHandUnbindRequestDTO
;
import
com.cusc.nirvana.user.rnr.mg.dto.MgRnrInfoDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
/**
* @author: jk
* @date: 2022/6/8 10:47
* @version: 1.0
*/
@Mapper
public
interface
PersonalRequestConvert
{
PersonalRequestConvert
INSTANCE
=
Mappers
.
getMapper
(
PersonalRequestConvert
.
class
);
MgRnrInfoDTO
requestDTOToMgRnrDTO
(
PersonalRequestDTO
bean
);
PersonalRequestDTO
secondHandUnbindDTOToPersonalRnrDTO
(
SecondHandUnbindRequestDTO
bean
);
PersonalRequestDTO
h5PersonRnrRequestToPersonRequstDTO
(
PersonalH5ReqDTO
dto
);
}
src/main/java/com/cusc/nirvana/user/rnr/customer/converter/RnrRecordConverter.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.converter
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrInfoRespDTO
;
import
com.cusc.nirvana.user.rnr.customer.dto.RnrRecordRespDTO
;
import
com.cusc.nirvana.user.rnr.mg.constants.RnrStatus
;
import
com.cusc.nirvana.user.rnr.mg.dto.MgRnrCardInfoDTO
;
import
com.cusc.nirvana.user.rnr.mg.dto.MgRnrInfoDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Description: 实名记录转换器
* <br />
* CreateDate 2022-05-06 15:49:41
*
* @author yuyi
**/
@Mapper
public
interface
RnrRecordConverter
{
RnrRecordConverter
INSTANCE
=
Mappers
.
getMapper
(
RnrRecordConverter
.
class
);
/**
* Description: card转
* <br />
* CreateDate 2021-11-18 15:21:27
*
* @author yuyi
**/
default
List
<
RnrRecordRespDTO
>
cardListToRnrRecordList
(
List
<
MgRnrCardInfoDTO
>
list
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
null
;
}
List
<
RnrRecordRespDTO
>
retList
=
new
ArrayList
<>();
RnrRecordRespDTO
record
;
for
(
MgRnrCardInfoDTO
tmp
:
list
)
{
record
=
new
RnrRecordRespDTO
();
record
.
setVin
(
tmp
.
getIotId
());
record
.
setIccid
(
tmp
.
getIccid
());
record
.
setRnrId
(
tmp
.
getRnrId
());
record
.
setCardStatus
(
tmp
.
getRnrStatus
());
record
.
setCardStatusName
(
RnrStatus
.
getEnumByCode
(
tmp
.
getRnrStatus
()).
getComment
());
record
.
setCreateTime
(
tmp
.
getCreateTime
());
retList
.
add
(
record
);
}
return
retList
;
}
/**
* Description: info dto转换Resp
* <br />
* CreateDate 2021-11-18 15:21:27
*
* @author yuyi
**/
@Mappings
({
@Mapping
(
target
=
"rnrId"
,
source
=
"uuid"
)
})
RnrInfoRespDTO
rnrInfoToViewInfo
(
MgRnrInfoDTO
bean
);
}
src/main/java/com/cusc/nirvana/user/rnr/customer/dto/ConsignerInfoDTO.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
/**
* @author: jk
* @description: 委托人信息
* @date: 2022/6/7 11:12
* @version: 1.0
* @Param:
* @Return:
*/
@Data
public
class
ConsignerInfoDTO
{
@ApiModelProperty
(
value
=
"委托人姓名"
)
@NotBlank
(
message
=
"委托人姓名不能为空"
)
private
String
fullName
;
@ApiModelProperty
(
value
=
"委托人手机号"
)
@NotBlank
(
message
=
"委托人手机号不能为空"
)
private
String
phone
;
@ApiModelProperty
(
value
=
"手机验证码"
)
@NotBlank
(
message
=
"手机验证码不能为空"
)
private
String
verificationCode
;
@ApiModelProperty
(
value
=
"性别"
)
@NotNull
(
message
=
"性别不能为空"
)
private
Integer
gender
;
@ApiModelProperty
(
value
=
"证件类型"
)
@NotBlank
(
message
=
"证件类型不能为空"
)
private
String
certType
;
@ApiModelProperty
(
value
=
"证件号码"
)
@NotBlank
(
message
=
"证件号码不能为空"
)
private
String
certNumber
;
@ApiModelProperty
(
value
=
"证件地址"
)
@NotBlank
(
message
=
"证件地址不能为空"
)
private
String
certAddress
;
@ApiModelProperty
(
value
=
"证件照片"
)
@NotEmpty
(
message
=
"证件照片不能为空"
)
private
List
<
String
>
certPic
;
@ApiModelProperty
(
value
=
"证件有效期"
)
@NotBlank
(
message
=
"证件有效期不能为空"
)
private
String
certExpirationDate
;
@ApiModelProperty
(
value
=
"通讯地址"
)
// @NotBlank(message = "通讯地址不能为空")
private
String
contactAddress
;
@ApiModelProperty
(
value
=
"委托书"
)
@NotEmpty
(
message
=
"委托书不能为空"
)
private
List
<
String
>
attorneyLetterPic
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/dto/DicDTO.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
DicDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5712879585098743234L
;
@ApiModelProperty
(
value
=
"标识名称"
)
private
String
label
;
@ApiModelProperty
(
value
=
"值"
)
private
String
value
;
}
src/main/java/com/cusc/nirvana/user/rnr/customer/dto/EMVinCardResponseDTO.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* @author yubo
* @since 2022-04-19 09:08
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
EMVinCardResponseDTO
{
//校验记录总数
private
int
totalCount
;
//校验失败记录数
private
int
failCount
;
//校验失败文件ID
private
String
fileId
;
//文件名称
private
String
fileName
;
// //校验成功记录
// private List<VinCardDTO> successList = new ArrayList<>();
public
EMVinCardResponseDTO
(
int
totalCount
,
int
failCount
,
String
fileId
)
{
this
.
totalCount
=
totalCount
;
this
.
failCount
=
failCount
;
this
.
fileId
=
fileId
;
}
}
src/main/java/com/cusc/nirvana/user/rnr/customer/dto/EffectiveTimeDTO.java
0 → 100644
View file @
88ce9651
package
com.cusc.nirvana.user.rnr.customer.dto
;
import
lombok.Data
;
/**
* @className: EffectiveTimeDTO
* @author: JK
* @date: 2022/7/22 13:40
* @version: 1.0
**/
@Data
public
class
EffectiveTimeDTO
{
//是否允许访问 true允许 false不允许
private
boolean
visit
;
private
String
startTime
;
private
String
endTime
;
}
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