Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
aef3b3e8
Commit
aef3b3e8
authored
Aug 15, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改特殊字符
parent
9c565fbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
34 deletions
+38
-34
HygfIcbcServiceImpl.java
...oot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
+38
-34
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
View file @
aef3b3e8
...
...
@@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import
java.net.URLDecoder
;
import
java.text.SimpleDateFormat
;
import
java.util.Arrays
;
import
java.util.Base64
;
import
java.util.Calendar
;
import
java.util.Collections
;
import
java.util.Date
;
...
...
@@ -50,7 +51,6 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.HygfIcbcRecordMapper;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfIcbcRequestMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IHygfIcbcService
;
import
cn.hutool.core.codec.Base64
;
import
lombok.extern.slf4j.Slf4j
;
/**
...
...
@@ -263,10 +263,10 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
params
.
put
(
"app_id"
,
app_id
);
params
.
put
(
"charset"
,
charset
);
params
.
put
(
"format"
,
format
);
params
.
put
(
"encrypt_type"
,
encrypt_type
);
params
.
put
(
"encrypt_type"
,
encrypt_type
);
params
.
put
(
"timestamp"
,
timestamp
);
//params.put("biz_content", "{\"busiCode\":\"11098243\",\"return_msg\":\"success\",\"outUserId\":\"11098243\",\"custName\":\"5p2O5Y2r5Lic\",\"marketingStaffId\":\"\",\"newPayAcc\":\"NjIxNDc2MTUwMjYwMjc5MDc4OQ==\",\"signEntrsutPrtlSucceedFlag\":\"1\",\"certNo\":\"MjI5MDA1MTk3MzEwMjUwMjFY\",\"appId\":\"11000000000000028870\",\"msg_id\":\"20240814190453416\",\"projectId\":\"PJ140014023565102203\",\"openAccoutSucceedFlag\":\"02\",\"return_code\":0}");
// params.put("biz_content",
// "{\"busiCode\":\"11098243\",\"return_msg\":\"success\",\"outUserId\":\"11098243\",\"custName\":\"5p2O5Y2r5Lic\",\"marketingStaffId\":\"\",\"newPayAcc\":\"NjIxNDc2MTUwMjYwMjc5MDc4OQ==\",\"signEntrsutPrtlSucceedFlag\":\"1\",\"certNo\":\"MjI5MDA1MTk3MzEwMjUwMjFY\",\"appId\":\"11000000000000028870\",\"msg_id\":\"20240814190453416\",\"projectId\":\"PJ140014023565102203\",\"openAccoutSucceedFlag\":\"02\",\"return_code\":0}");
params
.
put
(
"biz_content"
,
biz_content
);
params
.
put
(
"sign_type"
,
sign_type
);
// 目前上行网关签名暂时仅支持RSA
params
.
put
(
"sign"
,
sign
);
...
...
@@ -305,6 +305,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
hygfIcbcRecord
.
setIdCard
(
certNo
);
hygfIcbcRequest
.
setPhase
(
"组装"
);
hygfIcbcRequest
.
setException
(
data
.
get
(
"custName"
)
+
" -> "
+
custName
);
hygfIcbcRequestMapper
.
updateById
(
hygfIcbcRequest
);
PeasantHousehold
peasantHousehold
=
peasantHouseholdService
.
lambdaQuery
()
...
...
@@ -337,7 +338,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
// endregion
String
copReturnCode
=
"0"
;
// 通知合作方接收成功的返回码,固定
String
copReturnMsg
=
"success"
;
// 合作方的返回信息,固定
hygfIcbcRequest
.
setPhase
(
"加签返回"
);
hygfIcbcRequestMapper
.
updateById
(
hygfIcbcRequest
);
returnJson
=
sign
(
request
,
copReturnCode
,
copReturnMsg
);
...
...
@@ -482,34 +483,37 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
* @throws Exception
*/
private
boolean
verifySignData
(
HttpServletRequest
request
,
String
path
)
throws
Exception
{
// 网关公钥
Map
<
String
,
String
>
params
=
new
HashMap
<>();
String
api
=
request
.
getParameter
(
"api"
);
String
from
=
request
.
getParameter
(
"from"
);
String
app_id
=
request
.
getParameter
(
"app_id"
);
String
charset
=
request
.
getParameter
(
"charset"
);
String
format
=
request
.
getParameter
(
"format"
);
String
encrypt_type
=
request
.
getParameter
(
"encrypt_type"
);
String
timestamp
=
request
.
getParameter
(
"timestamp"
);
String
biz_content
=
request
.
getParameter
(
"biz_content"
);
String
sign_type
=
request
.
getParameter
(
"sign_type"
);
String
sign
=
request
.
getParameter
(
"sign"
);
log
.
info
(
"户用光伏开户签约异步通知, 入参,from:[[{}]], api:[[{}]], app_id:[[{}]], charset:[[{}]], format:[[{}]], encrypt_type:[[{}]], timestamp:[[{}]], biz_content:[[{}]], sign_type:[[{}]], sign:[[{}]]"
,
from
,
api
,
app_id
,
charset
,
format
,
encrypt_type
);
params
.
put
(
"from"
,
from
);
params
.
put
(
"api"
,
api
);
params
.
put
(
"app_id"
,
app_id
);
params
.
put
(
"charset"
,
charset
);
params
.
put
(
"format"
,
format
);
params
.
put
(
"encrypt_type"
,
encrypt_type
);
params
.
put
(
"timestamp"
,
timestamp
);
params
.
put
(
"biz_content"
,
biz_content
);
params
.
put
(
"sign_type"
,
sign_type
);
// 目前上行网关签名暂时仅支持RSA
/**********验证工行上行网关RSA签名**********/
String
signStr
=
WebUtils
.
buildOrderedSignStr
(
path
,
params
);
log
.
info
(
"验签入参,signStr:[[{}]], sign_type:[[{}]], APIGW_PUBLIC_KEY: [[{}]],charset:[[{}]],sign:[[{}]]"
,
signStr
,
sign_type
,
APIGW_PUBLIC_KEY
,
charset
,
sign
);
boolean
flag
=
IcbcSignature
.
verify
(
signStr
,
sign_type
,
APIGW_PUBLIC_KEY
,
charset
,
sign
);
log
.
info
(
"验签结果:[[{}]]"
,
flag
);
return
flag
;
// 网关公钥
Map
<
String
,
String
>
params
=
new
HashMap
<>();
String
api
=
request
.
getParameter
(
"api"
);
String
from
=
request
.
getParameter
(
"from"
);
String
app_id
=
request
.
getParameter
(
"app_id"
);
String
charset
=
request
.
getParameter
(
"charset"
);
String
format
=
request
.
getParameter
(
"format"
);
String
encrypt_type
=
request
.
getParameter
(
"encrypt_type"
);
String
timestamp
=
request
.
getParameter
(
"timestamp"
);
String
biz_content
=
request
.
getParameter
(
"biz_content"
);
String
sign_type
=
request
.
getParameter
(
"sign_type"
);
String
sign
=
request
.
getParameter
(
"sign"
);
log
.
info
(
"户用光伏开户签约异步通知, 入参,from:[[{}]], api:[[{}]], app_id:[[{}]], charset:[[{}]], format:[[{}]], encrypt_type:[[{}]], timestamp:[[{}]], biz_content:[[{}]], sign_type:[[{}]], sign:[[{}]]"
,
from
,
api
,
app_id
,
charset
,
format
,
encrypt_type
);
params
.
put
(
"from"
,
from
);
params
.
put
(
"api"
,
api
);
params
.
put
(
"app_id"
,
app_id
);
params
.
put
(
"charset"
,
charset
);
params
.
put
(
"format"
,
format
);
params
.
put
(
"encrypt_type"
,
encrypt_type
);
params
.
put
(
"timestamp"
,
timestamp
);
params
.
put
(
"biz_content"
,
biz_content
);
params
.
put
(
"sign_type"
,
sign_type
);
// 目前上行网关签名暂时仅支持RSA
/********** 验证工行上行网关RSA签名 **********/
String
signStr
=
WebUtils
.
buildOrderedSignStr
(
path
,
params
);
log
.
info
(
"验签入参,signStr:[[{}]], sign_type:[[{}]], APIGW_PUBLIC_KEY: [[{}]],charset:[[{}]],sign:[[{}]]"
,
signStr
,
sign_type
,
APIGW_PUBLIC_KEY
,
charset
,
sign
);
boolean
flag
=
IcbcSignature
.
verify
(
signStr
,
sign_type
,
APIGW_PUBLIC_KEY
,
charset
,
sign
);
log
.
info
(
"验签结果:[[{}]]"
,
flag
);
return
flag
;
}
/**
...
...
@@ -552,7 +556,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
return
""
;
}
char
[]
ch
=
str
.
toCharArray
();
byte
[]
bt
=
Base64
.
decode
(
String
.
valueOf
(
ch
));
byte
[]
bt
=
Base64
.
getDecoder
().
decode
(
String
.
valueOf
(
ch
));
return
new
String
(
bt
,
"UTF-8"
);
}
...
...
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