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
85d099d3
Commit
85d099d3
authored
Dec 29, 2022
by
5359
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流水号添加随机数
parent
7986c6ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
40 deletions
+53
-40
PingAnServiceImpl.java
...a/com/hand/app/pingAn/service/impl/PingAnServiceImpl.java
+52
-40
pingAn.properties
core/src/main/resources/pingAn.properties
+1
-0
No files found.
core/src/main/java/com/hand/app/pingAn/service/impl/PingAnServiceImpl.java
View file @
85d099d3
...
@@ -70,6 +70,7 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -70,6 +70,7 @@ public class PingAnServiceImpl implements PingAnService {
private
static
Properties
pro
=
null
;
private
static
Properties
pro
=
null
;
private
static
Calendar
cal
=
null
;
private
static
Calendar
cal
=
null
;
private
static
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
private
static
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
);
private
static
String
filePath
=
null
;
static
{
static
{
String
path
=
Thread
.
currentThread
().
getContextClassLoader
().
getResource
(
""
).
getPath
().
substring
(
1
);
String
path
=
Thread
.
currentThread
().
getContextClassLoader
().
getResource
(
""
).
getPath
().
substring
(
1
);
...
@@ -79,6 +80,7 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -79,6 +80,7 @@ public class PingAnServiceImpl implements PingAnService {
}
}
baseReqBody
.
put
(
"MrchCode"
,
pro
.
getProperty
(
"MrchCode"
));
baseReqBody
.
put
(
"MrchCode"
,
pro
.
getProperty
(
"MrchCode"
));
baseReqBody
.
put
(
"MainAccount"
,
pro
.
getProperty
(
"AcctNo"
));
baseReqBody
.
put
(
"MainAccount"
,
pro
.
getProperty
(
"AcctNo"
));
filePath
=
pro
.
getProperty
(
"pingAnDownloadFilePath"
);
}
}
...
@@ -88,13 +90,14 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -88,13 +90,14 @@ public class PingAnServiceImpl implements PingAnService {
* @return
* @return
*/
*/
@Override
@Override
public
JSONObject
invoke
(
IRequest
iRequest
,
String
interfaceName
,
JSONObject
params
)
{
public
JSONObject
invoke
(
IRequest
iRequest
,
String
interfaceName
,
JSONObject
params
)
{
JSONObject
responseData
=
new
JSONObject
();
JSONObject
responseData
=
new
JSONObject
();
// JSONObject requestBody = ApiUtils.getBaseReqBody();
// JSONObject requestBody = ApiUtils.getBaseReqBody();
JSONObject
requestBody
=
baseReqBody
.
clone
();
JSONObject
requestBody
=
baseReqBody
.
clone
();
cal
=
Calendar
.
getInstance
();
cal
=
Calendar
.
getInstance
();
String
today
=
df
.
format
(
cal
.
getTime
());
String
today
=
df
.
format
(
cal
.
getTime
());
requestBody
.
put
(
"CnsmrSeqNo"
,
today
+
"000"
);
long
temp
=
Math
.
round
(
Math
.
random
()
*
899
+
100
);
// 产生100到999的随机数
requestBody
.
put
(
"CnsmrSeqNo"
,
today
+
temp
);
requestBody
.
putAll
(
params
);
requestBody
.
putAll
(
params
);
/*插入接口日志表*/
/*插入接口日志表*/
...
@@ -166,6 +169,7 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -166,6 +169,7 @@ public class PingAnServiceImpl implements PingAnService {
JSONObject
responseData
=
new
JSONObject
();
JSONObject
responseData
=
new
JSONObject
();
logger
.
info
(
"接收推送消息,推送参数: {}"
,
req
.
toString
());
logger
.
info
(
"接收推送消息,推送参数: {}"
,
req
.
toString
());
if
(
Objects
.
nonNull
(
req
)
&&
req
.
size
()
>
0
)
{
if
(
Objects
.
nonNull
(
req
)
&&
req
.
size
()
>
0
)
{
try
{
// 存表
// 存表
//实际通知报文中会把数据放在ROOT这个key下
//实际通知报文中会把数据放在ROOT这个key下
JSONObject
data
=
req
.
getJSONObject
(
"ROOT"
);
JSONObject
data
=
req
.
getJSONObject
(
"ROOT"
);
...
@@ -182,14 +186,20 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -182,14 +186,20 @@ public class PingAnServiceImpl implements PingAnService {
transactionManager
.
commit
(
transactionStatus
);
transactionManager
.
commit
(
transactionStatus
);
// 调用系统的接口服务,推送通知数据
// 调用系统的接口服务,推送通知数据
JSONObject
ldo16
=
new
JSONObject
();
JSONObject
ldo16
=
new
JSONObject
();
ldo16
.
put
(
"transaction_id"
,
hlsEbankCcbTransaction
.
getTransactionId
());
ldo16
.
put
(
"transaction_id"
,
hlsEbankCcbTransaction
.
getTransactionId
());
postNotify
(
ldo16
.
toString
());
postNotify
(
ldo16
.
toString
());
responseData
.
put
(
"TxnReturnCode "
,
"000000"
);
}
catch
(
Exception
e
)
{
responseData
.
put
(
"TxnReturnMsg "
,
"接收成功"
);
e
.
printStackTrace
(
);
}
else
{
}
responseData
.
put
(
"TxnReturnCode "
,
"111111
"
);
// responseData.put("TxnReturnCode ","000000
");
responseData
.
put
(
"TxnReturnMsg "
,
"接收失败
"
);
// responseData.put("TxnReturnMsg ","接收成功
");
}
}
// else {
// responseData.put("TxnReturnCode ","111111");
// responseData.put("TxnReturnMsg ","接收失败");
// }
responseData
.
put
(
"TxnReturnCode "
,
"000000"
);
responseData
.
put
(
"TxnReturnMsg "
,
"接收成功"
);
return
responseData
;
return
responseData
;
}
}
...
@@ -297,7 +307,9 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -297,7 +307,9 @@ public class PingAnServiceImpl implements PingAnService {
orderFiles
.
add
(
orderFile
);
orderFiles
.
add
(
orderFile
);
}
}
OrderFileRequest
orderFileRequest
=
new
OrderFileRequest
();
OrderFileRequest
orderFileRequest
=
new
OrderFileRequest
();
orderFileRequest
.
setDownPath
(
"D:\\download\\yqzl"
);
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
String
dateString
=
formatter
.
format
(
new
Date
())
+
"\\"
;
orderFileRequest
.
setDownPath
(
filePath
+
dateString
);
File
file
=
new
File
(
orderFileRequest
.
getDownPath
());
File
file
=
new
File
(
orderFileRequest
.
getDownPath
());
if
(!
file
.
exists
())
{
if
(!
file
.
exists
())
{
file
.
mkdirs
();
file
.
mkdirs
();
...
@@ -323,13 +335,13 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -323,13 +335,13 @@ public class PingAnServiceImpl implements PingAnService {
JSONObject
res
=
invoke
(
iRequest
,
interfaceName
,
params
);
JSONObject
res
=
invoke
(
iRequest
,
interfaceName
,
params
);
// 对当前查询到的数据进行存表
// 对当前查询到的数据进行存表
JSONObject
data
=
res
.
getJSONObject
(
"data"
);
JSONObject
data
=
res
.
getJSONObject
(
"data"
);
if
(
Objects
.
nonNull
(
data
)){
if
(
Objects
.
nonNull
(
data
))
{
isEnd
=
data
.
getString
(
"IsEnd"
);
isEnd
=
data
.
getString
(
"IsEnd"
);
JSONArray
arr
=
data
.
getJSONArray
(
"list"
);
JSONArray
arr
=
data
.
getJSONArray
(
"list"
);
if
(
Objects
.
nonNull
(
arr
))
{
if
(
Objects
.
nonNull
(
arr
))
{
batchSaveTransactionByC00602
(
iRequest
,
arr
);
batchSaveTransactionByC00602
(
iRequest
,
arr
);
}
}
}
else
{
}
else
{
responseData
.
put
(
Constants
.
RESP_CODE
,
"1111"
);
responseData
.
put
(
Constants
.
RESP_CODE
,
"1111"
);
responseData
.
put
(
"respMsg"
,
"查询出错"
);
responseData
.
put
(
"respMsg"
,
"查询出错"
);
break
;
break
;
...
@@ -351,30 +363,30 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -351,30 +363,30 @@ public class PingAnServiceImpl implements PingAnService {
JSONObject
res
=
invoke
(
iRequest
,
interfaceName
,
params
);
JSONObject
res
=
invoke
(
iRequest
,
interfaceName
,
params
);
// 对当前查询到的数据进行存表
// 对当前查询到的数据进行存表
JSONObject
data
=
res
.
getJSONObject
(
"data"
);
JSONObject
data
=
res
.
getJSONObject
(
"data"
);
if
(
Objects
.
nonNull
(
data
)){
if
(
Objects
.
nonNull
(
data
))
{
if
(
mainFlag
){
if
(
mainFlag
)
{
// 处理主账户,每次查询只处理一次
// 处理主账户,每次查询只处理一次
HlsEbankCcbAccount
hlsEbankCcbAccount
=
new
HlsEbankCcbAccount
();
HlsEbankCcbAccount
hlsEbankCcbAccount
=
new
HlsEbankCcbAccount
();
hlsEbankCcbAccount
.
setAccountNo
(
data
.
getString
(
"ShadowAcctNo"
));
hlsEbankCcbAccount
.
setAccountNo
(
data
.
getString
(
"ShadowAcctNo"
));
Long
recordId
=
hlsEbankCcbAccountMapper
.
queryByAccountNo
(
hlsEbankCcbAccount
);
Long
recordId
=
hlsEbankCcbAccountMapper
.
queryByAccountNo
(
hlsEbankCcbAccount
);
hlsEbankCcbAccount
.
setSubAccNum
(
data
.
getLong
(
"SubAccNum"
));
hlsEbankCcbAccount
.
setSubAccNum
(
data
.
getLong
(
"SubAccNum"
));
hlsEbankCcbAccount
.
setStt
(
data
.
getString
(
"Stt"
));
hlsEbankCcbAccount
.
setStt
(
data
.
getString
(
"Stt"
));
if
(
Objects
.
nonNull
(
recordId
)){
if
(
Objects
.
nonNull
(
recordId
))
{
hlsEbankCcbAccount
.
setRecordId
(
recordId
);
hlsEbankCcbAccount
.
setRecordId
(
recordId
);
hlsEbankCcbAccountService
.
updateByPrimaryKeySelective
(
iRequest
,
hlsEbankCcbAccount
);
hlsEbankCcbAccountService
.
updateByPrimaryKeySelective
(
iRequest
,
hlsEbankCcbAccount
);
}
else
{
}
else
{
hlsEbankCcbAccount
.
setMainFlag
(
"Y"
);
hlsEbankCcbAccount
.
setMainFlag
(
"Y"
);
hlsEbankCcbAccount
.
setMainAccount
(
data
.
getString
(
"MainAccount"
));
hlsEbankCcbAccount
.
setMainAccount
(
data
.
getString
(
"MainAccount"
));
hlsEbankCcbAccount
.
setCorId
(
data
.
getString
(
"CorId"
));
hlsEbankCcbAccount
.
setCorId
(
data
.
getString
(
"CorId"
));
hlsEbankCcbAccount
.
setAccName
(
data
.
getString
(
"AccountName"
));
hlsEbankCcbAccount
.
setAccName
(
data
.
getString
(
"AccountName"
));
hlsEbankCcbAccountService
.
insertSelective
(
iRequest
,
hlsEbankCcbAccount
);
hlsEbankCcbAccountService
.
insertSelective
(
iRequest
,
hlsEbankCcbAccount
);
}
}
mainFlag
=
false
;
mainFlag
=
false
;
}
}
isEnd
=
data
.
getString
(
"IsEnd"
);
isEnd
=
data
.
getString
(
"IsEnd"
);
batchSaveAccount
(
iRequest
,
data
);
batchSaveAccount
(
iRequest
,
data
);
}
else
{
}
else
{
responseData
.
put
(
Constants
.
RESP_CODE
,
"1111"
);
responseData
.
put
(
Constants
.
RESP_CODE
,
"1111"
);
responseData
.
put
(
"respMsg"
,
"查询出错"
);
responseData
.
put
(
"respMsg"
,
"查询出错"
);
break
;
break
;
...
@@ -433,9 +445,9 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -433,9 +445,9 @@ public class PingAnServiceImpl implements PingAnService {
}
}
}
}
private
void
batchSaveAccount
(
IRequest
iRequest
,
JSONObject
data
){
private
void
batchSaveAccount
(
IRequest
iRequest
,
JSONObject
data
)
{
JSONArray
list
=
data
.
getJSONArray
(
"list"
);
JSONArray
list
=
data
.
getJSONArray
(
"list"
);
if
(
Objects
.
nonNull
(
list
)){
if
(
Objects
.
nonNull
(
list
))
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
JSONObject
item
=
list
.
getJSONObject
(
i
);
JSONObject
item
=
list
.
getJSONObject
(
i
);
HlsEbankCcbAccount
hlsEbankCcbAccount
=
new
HlsEbankCcbAccount
();
HlsEbankCcbAccount
hlsEbankCcbAccount
=
new
HlsEbankCcbAccount
();
...
@@ -444,15 +456,15 @@ public class PingAnServiceImpl implements PingAnService {
...
@@ -444,15 +456,15 @@ public class PingAnServiceImpl implements PingAnService {
hlsEbankCcbAccount
.
setSubAccNum
(
data
.
getLong
(
"SubAccNum"
));
hlsEbankCcbAccount
.
setSubAccNum
(
data
.
getLong
(
"SubAccNum"
));
hlsEbankCcbAccount
.
setStt
(
item
.
getString
(
"SubStt"
));
hlsEbankCcbAccount
.
setStt
(
item
.
getString
(
"SubStt"
));
hlsEbankCcbAccount
.
setAccBalance
(
item
.
getDouble
(
"SubAccBalance"
));
hlsEbankCcbAccount
.
setAccBalance
(
item
.
getDouble
(
"SubAccBalance"
));
if
(
Objects
.
nonNull
(
recordId
)){
if
(
Objects
.
nonNull
(
recordId
))
{
hlsEbankCcbAccount
.
setRecordId
(
recordId
);
hlsEbankCcbAccount
.
setRecordId
(
recordId
);
hlsEbankCcbAccountService
.
updateByPrimaryKeySelective
(
iRequest
,
hlsEbankCcbAccount
);
hlsEbankCcbAccountService
.
updateByPrimaryKeySelective
(
iRequest
,
hlsEbankCcbAccount
);
}
else
{
}
else
{
hlsEbankCcbAccount
.
setMainFlag
(
"N"
);
hlsEbankCcbAccount
.
setMainFlag
(
"N"
);
hlsEbankCcbAccount
.
setMainAccount
(
data
.
getString
(
"MainAccount"
));
hlsEbankCcbAccount
.
setMainAccount
(
data
.
getString
(
"MainAccount"
));
hlsEbankCcbAccount
.
setCorId
(
data
.
getString
(
"CorId"
));
hlsEbankCcbAccount
.
setCorId
(
data
.
getString
(
"CorId"
));
hlsEbankCcbAccount
.
setAccName
(
item
.
getString
(
"SubAccName"
));
hlsEbankCcbAccount
.
setAccName
(
item
.
getString
(
"SubAccName"
));
hlsEbankCcbAccountService
.
insertSelective
(
iRequest
,
hlsEbankCcbAccount
);
hlsEbankCcbAccountService
.
insertSelective
(
iRequest
,
hlsEbankCcbAccount
);
}
}
}
}
}
}
...
...
core/src/main/resources/pingAn.properties
View file @
85d099d3
...
@@ -9,6 +9,7 @@ queryOrderFileUrl=https://my-st1.orangebank.com.cn:567/fat7/openapi/file/boapFil
...
@@ -9,6 +9,7 @@ queryOrderFileUrl=https://my-st1.orangebank.com.cn:567/fat7/openapi/file/boapFil
fileDownLoadOrderFileUrl
=
https://my-st1.orangebank.com.cn:567/fat7/openapi/file/boapFile/downloadOrderFile
fileDownLoadOrderFileUrl
=
https://my-st1.orangebank.com.cn:567/fat7/openapi/file/boapFile/downloadOrderFile
MrchCode
=
0090108040000KTAR000
MrchCode
=
0090108040000KTAR000
AcctNo
=
15000101414037
AcctNo
=
15000101414037
pingAnDownloadFilePath
=
E:
\\
HCLC_FTP
\\
PAB_IN
\\
#测试客户名称:天津市佳兴机械设备租赁有限公司
#测试客户名称:天津市佳兴机械设备租赁有限公司
#测试合同:L21BD00209
#测试合同:L21BD00209
\ No newline at end of file
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