Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-support-rlwx
Project
Project
Details
Activity
Releases
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
rl
hls-support-rlwx
Commits
d3fdde6a
Commit
d3fdde6a
authored
Dec 22, 2022
by
胡建龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]修复调用业务系统参数错误及事务提交
parent
461ea36e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
PingAnServiceImpl.java
...a/com/hand/app/pingAn/service/impl/PingAnServiceImpl.java
+24
-4
No files found.
core/src/main/java/com/hand/app/pingAn/service/impl/PingAnServiceImpl.java
View file @
d3fdde6a
...
...
@@ -32,7 +32,11 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.support.DefaultTransactionDefinition
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
...
...
@@ -49,6 +53,8 @@ public class PingAnServiceImpl implements PingAnService {
private
IHlsEbankCcbTransactionService
hlsEbankCcbTransactionService
;
@Autowired
private
HlsEbankCcbTransactionMapper
hlsEbankCcbTransactionMapper
;
@Autowired
private
DataSourceTransactionManager
transactionManager
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
...
...
@@ -146,14 +152,28 @@ public class PingAnServiceImpl implements PingAnService {
}
public
JSONObject
detailNotify
(
IRequest
iRequest
,
JSONObject
data
)
{
public
JSONObject
detailNotify
(
IRequest
iRequest
,
JSONObject
req
)
{
JSONObject
responseData
=
new
JSONObject
();
logger
.
info
(
"接收推送消息,推送参数: {}"
,
data
.
toString
());
if
(
Objects
.
nonNull
(
data
)
&&
data
.
size
()
>
0
)
{
logger
.
info
(
"接收推送消息,推送参数: {}"
,
req
.
toString
());
if
(
Objects
.
nonNull
(
req
)
&&
req
.
size
()
>
0
)
{
// 存表
//实际通知报文中会把数据放在ROOT这个key下
JSONObject
data
=
req
.
getJSONObject
(
"ROOT"
);
DefaultTransactionDefinition
def
=
new
DefaultTransactionDefinition
();
// 事务隔离级别:开启新事务
def
.
setPropagationBehavior
(
TransactionDefinition
.
PROPAGATION_REQUIRES_NEW
);
//对于每次请求都开启一个事物
TransactionStatus
transactionStatus
=
transactionManager
.
getTransaction
(
def
);
HlsEbankCcbTransaction
hlsEbankCcbTransaction
=
saveTransaction
(
iRequest
,
data
);
//状态刷新
transactionStatus
.
flush
();
//事务提交
transactionManager
.
commit
(
transactionStatus
);
// 调用系统的接口服务,推送通知数据
postNotify
(
JSONObject
.
toJSONString
(
hlsEbankCcbTransaction
));
JSONObject
ldo16
=
new
JSONObject
();
ldo16
.
put
(
"transaction_id"
,
hlsEbankCcbTransaction
.
getTransactionId
());
postNotify
(
ldo16
.
toString
());
responseData
.
put
(
"TxnReturnCode "
,
"000000"
);
responseData
.
put
(
"TxnReturnMsg "
,
"接收成功"
);
}
else
{
...
...
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