Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
extend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
park
extend
Commits
0a37ab8e
Commit
0a37ab8e
authored
Jul 22, 2020
by
牟邦恺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
添加驾驶证图片反面查看
parent
55e3e63b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/DrivingLicenseController.java
+7
-8
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/DrivingLicenseServiceImpl.java
+5
-4
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/core/config/DrawConfig.java
+7
-0
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/DrivingLicenseController.java
View file @
0a37ab8e
...
...
@@ -17,7 +17,6 @@ import com.hikcreate.edl.pub.web.mobile.infra.core.configbean.FastDfsConfigBean;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.DrivingLicenseFeign
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.request.CreditIdCardMicReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.data.feign.edl_pvt_service_drivinglicense.response.DrivingLicenseMicRes
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseSendSmsCodeReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseValidReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.request.DrivingLicenseValidSmsCodeReq
;
import
com.hikcreate.edl.pub.web.mobile.infra.model.param.response.DrivingLicenseInfoRes
;
...
...
@@ -67,9 +66,9 @@ public class DrivingLicenseController {
return
ResultGenerator
.
success
(
drivingLicenseValidRes
);
}
@
Pos
tMapping
(
"/sendSmsCode"
)
public
Result
<
Void
>
sendSmsCode
(
@Request
Body
@Validated
DrivingLicenseSendSmsCodeReq
req
)
{
drivingLicenseService
.
sendSmsCode
(
req
.
getUserId
()
);
@
Ge
tMapping
(
"/sendSmsCode"
)
public
Result
<
Void
>
sendSmsCode
(
@Request
Param
(
"userId"
)
String
userId
)
{
drivingLicenseService
.
sendSmsCode
(
userId
);
return
ResultGenerator
.
success
();
}
...
...
@@ -79,7 +78,7 @@ public class DrivingLicenseController {
return
ResultGenerator
.
success
();
}
@GetMapping
(
"/
drivingLicenseI
nfo"
)
@GetMapping
(
"/
i
nfo"
)
public
Result
<
DrivingLicenseInfoRes
>
getDrivingLicenseInfo
(
@RequestParam
(
"userId"
)
String
userId
)
{
DrivingLicenseInfoRes
drivingLicenseInfoRes
=
drivingLicenseService
.
getDrivingLicenseInfo
(
userId
);
return
ResultGenerator
.
success
(
drivingLicenseInfoRes
);
...
...
@@ -88,13 +87,13 @@ public class DrivingLicenseController {
@GetMapping
(
"/image"
)
public
void
image
(
@RequestParam
(
"userId"
)
String
userId
,
@RequestParam
(
"idCard"
)
String
idCard
,
@RequestParam
(
"type"
)
Integer
type
,
HttpServletResponse
response
)
{
// 验证是否有查看权限
if
(!
drivingLicenseService
.
checkValid
(
userId
,
idCard
)
&&
!
iBindService
.
checkValid
(
userId
,
idCard
))
{
throw
new
BusinessException
(
StatusCode
.
PARAM_ERROR
);
if
(!
drivingLicenseService
.
checkValid
(
userId
,
idCard
)
&&
!
iBindService
.
checkValid
(
userId
,
idCard
))
{
throw
new
BusinessException
(
StatusCode
.
PARAM_ERROR
);
}
DrivingLicenseMicRes
drivingLicenseMicRes
=
drivingLicenseFeign
.
getByIdCard
(
new
CreditIdCardMicReq
().
setIdCard
(
idCard
)).
fallback
().
getData
();
ByteArrayOutputStream
outputStream
;
if
(
type
==
null
||
Objects
.
equals
(
type
,
1
))
{
if
(
type
==
null
||
Objects
.
equals
(
type
,
1
))
{
DlImageDO
dlImageDO
=
new
DlImageDO
();
dlImageDO
.
setAddress
(
drivingLicenseMicRes
.
getAddress
());
dlImageDO
.
setBelowLicenseNumber
(
drivingLicenseMicRes
.
getIdCard
());
...
...
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/DrivingLicenseServiceImpl.java
View file @
0a37ab8e
...
...
@@ -44,6 +44,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
static
final
String
REDIS_KEY
=
"drv:idcard"
;
private
static
final
String
REDIS_SMS_KEY
=
"drv:idcard:sms"
;
private
static
final
String
SMS_CODE
=
"PARK_DRIVING_LICENSE_IDCARD"
;
@Override
public
DrivingLicenseValidRes
checkIdCard
(
String
idCard
,
String
userId
)
{
...
...
@@ -58,9 +59,9 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
drivingLicenseValidRes
.
setPhone
(
drivingLicenseMicRes
.
getPhone
());
// 检查短信发送
if
(
checkSmsValid
(
userId
,
idCard
,
drivingLicenseMicRes
.
getPhone
()))
{
drivingLicenseValidRes
.
setSendSmsFlag
(
true
);
}
else
{
drivingLicenseValidRes
.
setSendSmsFlag
(
false
);
}
else
{
drivingLicenseValidRes
.
setSendSmsFlag
(
true
);
}
return
drivingLicenseValidRes
;
}
...
...
@@ -71,7 +72,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
SendVerifyCodeMicReq
micReq
=
new
SendVerifyCodeMicReq
();
micReq
.
setPhone
(
drivingLicenseMicRes
.
getPhone
());
micReq
.
setVerifyCode
(
VerifyCodeUtil
.
getCode
());
micReq
.
setTemplateCode
(
"PARK_DRIVING_LICENSE_IDCARD"
);
micReq
.
setTemplateCode
(
SMS_CODE
);
smsFeign
.
sendVerifyCode
(
micReq
).
fallback
();
}
...
...
@@ -81,7 +82,7 @@ public class DrivingLicenseServiceImpl implements DrivingLicenseService {
CheckVerifyCodeMicReq
req
=
new
CheckVerifyCodeMicReq
();
req
.
setPhone
(
drivingLicenseMicRes
.
getPhone
());
req
.
setVerifyCode
(
smsCode
);
req
.
setTemplateCode
(
"PARK_DRIVING_LICENSE_IDCARD"
);
req
.
setTemplateCode
(
SMS_CODE
);
smsFeign
.
checkVerifyCode
(
req
).
fallback
();
// 保存验证redis
saveSmsValid
(
userId
,
drivingLicenseMicRes
.
getIdCard
(),
drivingLicenseMicRes
.
getPhone
());
...
...
infra/src/main/java/com/hikcreate/edl/pub/web/mobile/infra/core/config/DrawConfig.java
View file @
0a37ab8e
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
infra
.
core
.
config
;
import
com.hikcreate.edl.common.image.builder.refactor.material.DlBackMaterial
;
import
com.hikcreate.edl.common.image.builder.refactor.material.DlMaterial
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -18,4 +19,10 @@ public class DrawConfig {
return
new
DlMaterial
();
}
@Bean
@ConfigurationProperties
(
"biz.image.builder.dl-back"
)
public
DlBackMaterial
dlBackMaterial
()
{
return
new
DlBackMaterial
();
}
}
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