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
3c96bedb
Commit
3c96bedb
authored
4 years ago
by
lixian7
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-20200720' into 'test'
Feature 20200720 See merge request
!26
parents
9e28c5d3
7a416196
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
20 deletions
+67
-20
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
+9
-3
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/DrivingLicenseController.java
+27
-17
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/CredentialsImageService.java
+10
-0
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/CredentialsImageServiceImpl.java
+21
-0
No files found.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/BindInfoControlller.java
View file @
3c96bedb
...
...
@@ -48,8 +48,8 @@ public class BindInfoControlller extends BaseController {
* @date: 2020/6/19 10:27
*/
@PostMapping
(
"bind"
)
//
@BodyDecryptAnnotation
//
@ResponseEncryptAnnotation
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
public
Result
bindInfo
(
@RequestBody
@Validated
BindInfoReq
req
)
{
Result
response
=
null
;
try
{
...
...
@@ -65,11 +65,13 @@ public class BindInfoControlller extends BaseController {
}
/**
* 车辆绑定短信验证
几节课
* 车辆绑定短信验证
* @param req
* @return
*/
@PostMapping
(
"bind/smsValid"
)
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
public
Result
<
BindInfoRes
>
bindSmsValid
(
@RequestBody
@Validated
BindSmsValidReq
req
)
{
return
service
.
bindSmsValid
(
req
);
}
...
...
@@ -105,6 +107,8 @@ public class BindInfoControlller extends BaseController {
* @return
*/
@PostMapping
(
"admin/unbind"
)
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
public
Result
adminUnbind
(
@RequestBody
@Validated
AdminUnbindReq
req
)
{
Result
result
=
null
;
try
{
...
...
@@ -124,6 +128,8 @@ public class BindInfoControlller extends BaseController {
* @return
*/
@PostMapping
(
"admin/unbind/smsValid"
)
@BodyDecryptAnnotation
@ResponseEncryptAnnotation
public
Result
adminUnbindSmsValid
(
@RequestBody
@Validated
AdminUnbindSmsValidReq
req
)
{
Result
result
=
null
;
try
{
...
...
This diff is collapsed.
Click to expand it.
api/src/main/java/com/hikcreate/edl/pub/web/mobile/api/controller/DrivingLicenseController.java
View file @
3c96bedb
...
...
@@ -5,6 +5,7 @@ import com.hikcreate.common.sdk.exception.BusinessException;
import
com.hikcreate.common.sdk.response.apiparam.Response
;
import
com.hikcreate.common.sdk.response.apiparam.ResponseGenerator
;
import
com.hikcreate.common.sdk.response.statuscode.StatusCode
;
import
com.hikcreate.edl.common.image.builder.domain.DlBackImageDO
;
import
com.hikcreate.edl.common.image.builder.domain.DlImageDO
;
import
com.hikcreate.edl.pub.web.mobile.domain.CredentialsImageService
;
import
com.hikcreate.edl.pub.web.mobile.domain.DrivingLicenseService
;
...
...
@@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.Objects
;
/**
* 驾驶证图片接口
...
...
@@ -84,29 +86,37 @@ public class DrivingLicenseController {
}
@GetMapping
(
"/image"
)
public
void
image
(
@RequestParam
(
"userId"
)
String
userId
,
@RequestParam
(
"idCard"
)
String
idCard
,
HttpServletResponse
response
)
{
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
);
}
DrivingLicenseMicRes
drivingLicenseMicRes
=
drivingLicenseFeign
.
getByIdCard
(
new
CreditIdCardMicReq
().
setIdCard
(
idCard
)).
fallback
().
getData
();
DlImageDO
dlImageDO
=
new
DlImageDO
();
dlImageDO
.
setAddress
(
drivingLicenseMicRes
.
getAddress
());
dlImageDO
.
setBelowLicenseNumber
(
drivingLicenseMicRes
.
getIdCard
());
dlImageDO
.
setAvatarFullUrl
(
fastDfsConfigBean
.
genBigDataInnerUrl
(
drivingLicenseMicRes
.
getAvatar
()));
dlImageDO
.
setBirthday
(
drivingLicenseMicRes
.
getBirthday
());
dlImageDO
.
setLicenseNumber
(
drivingLicenseMicRes
.
getIdCard
());
dlImageDO
.
setInitLicenseDate
(
drivingLicenseMicRes
.
getIssueDate
());
dlImageDO
.
setName
(
drivingLicenseMicRes
.
getRealName
());
dlImageDO
.
setBelowName
(
drivingLicenseMicRes
.
getRealName
());
dlImageDO
.
setModel
(
drivingLicenseMicRes
.
getLicenseType
());
dlImageDO
.
setNationality
(
drivingLicenseMicRes
.
getNationality
());
dlImageDO
.
setSex
(
drivingLicenseMicRes
.
getGender
());
dlImageDO
.
setValidityPeriod
(
drivingLicenseMicRes
.
getEffectiveDate
()
+
"至"
+
drivingLicenseMicRes
.
getExpiryDate
());
dlImageDO
.
setRecord
(
""
);
dlImageDO
.
setFileNumber
(
drivingLicenseMicRes
.
getFileNum
());
ByteArrayOutputStream
outputStream
=
(
ByteArrayOutputStream
)
credentialsImageService
.
genDlImage
(
dlImageDO
);
ByteArrayOutputStream
outputStream
;
if
(
type
==
null
||
Objects
.
equals
(
type
,
1
))
{
DlImageDO
dlImageDO
=
new
DlImageDO
();
dlImageDO
.
setAddress
(
drivingLicenseMicRes
.
getAddress
());
dlImageDO
.
setBelowLicenseNumber
(
drivingLicenseMicRes
.
getIdCard
());
dlImageDO
.
setAvatarFullUrl
(
fastDfsConfigBean
.
genBigDataInnerUrl
(
drivingLicenseMicRes
.
getAvatar
()));
dlImageDO
.
setBirthday
(
drivingLicenseMicRes
.
getBirthday
());
dlImageDO
.
setLicenseNumber
(
drivingLicenseMicRes
.
getIdCard
());
dlImageDO
.
setInitLicenseDate
(
drivingLicenseMicRes
.
getIssueDate
());
dlImageDO
.
setName
(
drivingLicenseMicRes
.
getRealName
());
dlImageDO
.
setBelowName
(
drivingLicenseMicRes
.
getRealName
());
dlImageDO
.
setModel
(
drivingLicenseMicRes
.
getLicenseType
());
dlImageDO
.
setNationality
(
drivingLicenseMicRes
.
getNationality
());
dlImageDO
.
setSex
(
drivingLicenseMicRes
.
getGender
());
dlImageDO
.
setValidityPeriod
(
drivingLicenseMicRes
.
getEffectiveDate
()
+
"至"
+
drivingLicenseMicRes
.
getExpiryDate
());
dlImageDO
.
setRecord
(
""
);
dlImageDO
.
setFileNumber
(
drivingLicenseMicRes
.
getFileNum
());
outputStream
=
(
ByteArrayOutputStream
)
credentialsImageService
.
genDlImage
(
dlImageDO
);
}
else
{
DlBackImageDO
dlBackImageDO
=
new
DlBackImageDO
();
dlBackImageDO
.
setRecordContents
(
""
);
dlBackImageDO
.
setSerialNum
(
""
);
outputStream
=
(
ByteArrayOutputStream
)
credentialsImageService
.
genDlBackImage
(
dlBackImageDO
);
}
try
{
setHeader
(
response
,
drivingLicenseMicRes
.
getIdCard
()
+
".jpg"
);
response
.
getOutputStream
().
write
(
outputStream
.
toByteArray
());
...
...
This diff is collapsed.
Click to expand it.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/CredentialsImageService.java
View file @
3c96bedb
package
com
.
hikcreate
.
edl
.
pub
.
web
.
mobile
.
domain
;
import
com.hikcreate.edl.common.image.builder.domain.DlBackImageDO
;
import
com.hikcreate.edl.common.image.builder.domain.DlImageDO
;
import
java.io.OutputStream
;
...
...
@@ -17,4 +18,13 @@ public interface CredentialsImageService {
* @return
*/
OutputStream
genDlImage
(
DlImageDO
params
);
/**
* 生成驾驶证背面图片
*
* @param params 参数
* @return
*/
OutputStream
genDlBackImage
(
DlBackImageDO
params
);
}
This diff is collapsed.
Click to expand it.
domain/src/main/java/com/hikcreate/edl/pub/web/mobile/domain/impl/CredentialsImageServiceImpl.java
View file @
3c96bedb
...
...
@@ -2,6 +2,7 @@ package com.hikcreate.edl.pub.web.mobile.domain.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.hikcreate.common.sdk.exception.BusinessException
;
import
com.hikcreate.edl.common.image.builder.domain.DlBackImageDO
;
import
com.hikcreate.edl.common.image.builder.domain.DlImageDO
;
import
com.hikcreate.edl.common.image.builder.refactor.DrawDispatcher
;
import
com.hikcreate.edl.pub.web.mobile.domain.CredentialsImageService
;
...
...
@@ -18,6 +19,7 @@ import java.io.OutputStream;
@Slf4j
@Service
public
class
CredentialsImageServiceImpl
implements
CredentialsImageService
{
@Autowired
private
DrawDispatcher
drawDispatcher
;
...
...
@@ -32,4 +34,23 @@ public class CredentialsImageServiceImpl implements CredentialsImageService {
}
return
outputStream
;
}
/**
* 生成驾驶证背面图片
*
* @param params 参数
* @return
*/
@Override
public
OutputStream
genDlBackImage
(
DlBackImageDO
params
)
{
OutputStream
outputStream
;
try
{
outputStream
=
drawDispatcher
.
drawDlBack
(
params
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Gen DrivingLicense back Image Error, param={}, msg={}"
,
JSONObject
.
toJSONString
(
params
),
e
);
throw
new
BusinessException
(
"获取驾驶证图片失败"
);
}
return
outputStream
;
}
}
This diff is collapsed.
Click to expand it.
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