Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
0203be46
Commit
0203be46
authored
Nov 01, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.certType有aes加密调整未base64编码
parent
9b4ae6d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
CertDetailServiceImpl.java
...ot/module/app/biz/service/impl/CertDetailServiceImpl.java
+15
-4
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+8
-2
No files found.
amos-boot-system-tzs/amos-boot-module-app/amos-boot-module-app-biz/src/main/java/com/yeejoin/amos/boot/module/app/biz/service/impl/CertDetailServiceImpl.java
View file @
0203be46
package
com
.
yeejoin
.
amos
.
boot
.
module
.
app
.
biz
.
service
.
impl
;
import
cn.hutool.core.codec.Base64Decoder
;
import
cn.hutool.core.codec.Base64Encoder
;
import
com.yeejoin.amos.boot.biz.common.dto.JgUseRegistrationManageDto
;
import
com.yeejoin.amos.boot.module.app.api.dto.CertInfoRequestParam
;
import
com.yeejoin.amos.boot.module.app.api.exception.AuthException
;
...
...
@@ -10,6 +12,7 @@ import com.yeejoin.amos.boot.module.common.api.enums.CertificateStatusEnum;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Map
;
@Service
...
...
@@ -27,19 +30,27 @@ public class CertDetailServiceImpl {
this
.
setDefaultFieldForOld
(
requestParam
);
String
certOrApplyNo
=
this
.
deCodeCertNo
(
requestParam
.
getCertNo
());
String
version
=
this
.
deCodeByAES
(
requestParam
.
getVersion
());
String
certType
=
this
.
deCodeBy
AES
(
requestParam
.
getCertType
());
String
certType
=
this
.
deCodeBy
Base64
(
requestParam
.
getCertType
());
JgUseRegistrationManageDto
jgUseRegistrationManage
=
this
.
checkParam
(
certOrApplyNo
,
version
);
return
SearchDetailStrategyContext
.
getHandler
(
this
.
getManageType
(
jgUseRegistrationManage
)).
hanlder
(
jgUseRegistrationManage
,
certType
);
}
private
String
deCodeByBase64
(
String
certType
)
{
try
{
return
Base64Decoder
.
decodeStr
(
certType
,
StandardCharsets
.
UTF_8
);
}
catch
(
Exception
e
)
{
throw
new
AuthException
(
"非法的二维码!"
);
}
}
private
void
setDefaultFieldForOld
(
CertInfoRequestParam
requestParam
)
{
// 兼容老数据,默认版本号为1
// 兼容老数据,默认版本号为1
aes 加密
if
(
StringUtils
.
isBlank
(
requestParam
.
getVersion
()))
{
requestParam
.
setVersion
(
AESUtil
.
encrypt
(
"1"
));
}
// 兼容老数据,默认类型为使用登记证,扩展预览字段
// 兼容老数据,默认类型为使用登记证,扩展预览字段
base64
if
(
StringUtils
.
isBlank
(
requestParam
.
getCertType
()))
{
requestParam
.
setCertType
(
AESUtil
.
encrypt
(
"useCert"
));
requestParam
.
setCertType
(
Base64Encoder
.
encode
(
"useCert"
,
StandardCharsets
.
UTF_8
));
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
0203be46
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.codec.Base64Decoder
;
import
cn.hutool.core.codec.Base64Encoder
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
...
...
@@ -100,6 +102,7 @@ import java.lang.reflect.Field;
import
java.lang.reflect.Modifier
;
import
java.math.BigDecimal
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.text.ParseException
;
import
java.util.*
;
...
...
@@ -947,14 +950,17 @@ public class CommonServiceImpl implements ICommonService {
}
private
String
getEncodeQrCode
(
String
certNo
,
String
certType
,
String
version
)
{
// aes加密并base64编码
String
certNoEncrypt
=
AESUtil
.
encrypt
(
certNo
);
String
certTypeEncrypt
=
AESUtil
.
encrypt
(
certType
);
// base64编码
String
certTypeBase64
=
Base64Encoder
.
encode
(
certType
,
StandardCharsets
.
UTF_8
);
// aes加密并base64编码
String
versionEncrypt
=
AESUtil
.
encrypt
(
version
);
return
qrcodePrefix
+
"?certNo="
+
certNoEncrypt
+
"&certType="
+
certType
Encrypt
+
certType
Base64
+
"&version="
+
versionEncrypt
;
}
...
...
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