Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
0786a586
Commit
0786a586
authored
Sep 27, 2024
by
chenyuxi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:网银入账优化
parent
4f5229b8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
21 deletions
+50
-21
EkpSocialInfoMapper.java
...om/yifu/cloud/plus/v1/ekp/mapper/EkpSocialInfoMapper.java
+1
-1
IcbcTransactionFlowQueryServiceImpl.java
...ekp/service/impl/IcbcTransactionFlowQueryServiceImpl.java
+46
-17
EkpSocialInfoMapper.xml
...ekp-biz/src/main/resources/mapper/EkpSocialInfoMapper.xml
+3
-3
No files found.
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/mapper/EkpSocialInfoMapper.java
View file @
0786a586
...
...
@@ -40,7 +40,7 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> {
* @param
* @return
*/
List
<
String
>
getAllserioNo
();
List
<
Map
<
String
,
String
>
>
getAllserioNo
();
/**
* 获取需要拉流水的银行账户
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/IcbcTransactionFlowQueryServiceImpl.java
View file @
0786a586
...
...
@@ -60,6 +60,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
@Autowired
private
EkpEntryProperties
ekpEntryProperties
;
@Override
public
R
getIcbcTransactionFlow
()
{
// //应用id 应用方私钥 网关公钥 应用方加密串
// String APP_ID = "11000000000000028685";
...
...
@@ -122,8 +123,9 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
log
.
info
(
"开始推当日新增网银到账明细条数"
);
String
tranDate
=
DateUtil
.
getThisDay
();
// todo 测试时改为查10天内的,上线改为查当天内的
String
beginDate
=
DateUtil
.
addDay
(-
10
).
replace
(
"-"
,
""
);
// 测试时改为查10天内的,上线改为查当天内的
// String beginDate = DateUtil.addDay(-10).replace("-","");
String
beginDate
=
tranDate
;
String
endDate
=
tranDate
;
return
getIcbcTransactionFlowCommon
(
tranDate
,
beginDate
,
endDate
);
...
...
@@ -166,8 +168,23 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return
R
.
ok
();
}
// 查询当天的所有入账记录数据
List
<
String
>
serioList
=
baseMapper
.
getAllserioNo
();
// 查询当天的所有入账记录数据, 查账号和流水号
List
<
Map
<
String
,
String
>>
serioList
=
baseMapper
.
getAllserioNo
();
// 整理各个账户下的流水:账号为key,账户下流水号列表作为value
Map
<
String
,
List
<
String
>>
serioMapByAccount
=
new
HashMap
<>();
if
(!
serioList
.
isEmpty
())
{
for
(
Map
<
String
,
String
>
serio:
serioList
)
{
List
<
String
>
serioListByAccountOne
=
serioMapByAccount
.
get
(
serio
.
get
(
"receiveBkNo"
));
if
(
serioListByAccountOne
==
null
||
serioListByAccountOne
.
isEmpty
()){
serioListByAccountOne
=
new
ArrayList
<>();
}
serioListByAccountOne
.
add
(
serio
.
get
(
"onlySequence"
));
serioMapByAccount
.
put
(
serio
.
get
(
"receiveBkNo"
),
serioListByAccountOne
);
}
}
// 账号为key,账户名称作为value
Map
<
String
,
String
>
accountInfoMap
=
new
HashMap
<>();
// 账号为key,账号下的流水作为value
...
...
@@ -207,19 +224,29 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
// 重新过滤已存入【入账记录】的流水信息
for
(
String
account
:
accountRecordListMap
.
keySet
())
{
// 获取当前账号下的流水
List
<
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
>
flowRecordList
=
accountRecordListMap
.
get
(
account
);
// 获取成功后根据流水号去重和根据借贷标志02筛选出所有数据
if
(!
flowRecordList
.
isEmpty
())
{
List
<
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
>
insertList
=
flowRecordList
.
stream
().
filter
(
e
->
e
.
getDrcrf
().
equals
(
"2"
)
&&
!
serioList
.
contains
(
e
.
getOnlySequence
())).
collect
(
Collectors
.
toList
());
if
(!
insertList
.
isEmpty
()){
// 还有需要存的流水,重新存入账号流水Map里
accountRecordListMap
.
put
(
account
,
insertList
);
}
else
{
// 没有需要存的流水,账号流水Map重置值为空列表
accountRecordListMap
.
put
(
account
,
new
ArrayList
<>());
// 获取当前账户下的入账记录:账号为key,账户下入账记录列表作为value
List
<
String
>
serioListByAccount
=
serioMapByAccount
.
get
(
account
);
if
(
serioListByAccount
==
null
||
serioListByAccount
.
isEmpty
()){
serioListByAccount
=
new
ArrayList
<>();
}
// 过滤出需要新增流水的数据
List
<
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
>
insertList
=
new
ArrayList
<>();
for
(
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
flowRecord
:
flowRecordList
)
{
if
(
"2"
.
equals
(
flowRecord
.
getDrcrf
())
&&
!
serioListByAccount
.
contains
(
flowRecord
.
getOnlySequence
())){
insertList
.
add
(
flowRecord
);
}
}
// 重新存入账号流水Map里
accountRecordListMap
.
put
(
account
,
insertList
);
}
}
...
...
@@ -227,10 +254,10 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
for
(
String
account
:
accountRecordListMap
.
keySet
())
{
List
<
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
>
saveList
=
accountRecordListMap
.
get
(
account
);
// 封装数据
if
(!
saveList
.
isEmpty
())
{
if
(
saveList
!=
null
&&
!
saveList
.
isEmpty
())
{
String
bankName
=
accountInfoMap
.
get
(
account
);
log
.
info
(
"
到账
明细条数:"
+
saveList
.
size
());
log
.
info
(
"需要存的流水到账--银行名称:"
+
bankName
);
log
.
info
(
"
需要存的流水到账--
明细条数:"
+
saveList
.
size
());
try
{
for
(
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
entry
:
saveList
)
{
EKPEntryPushParam
pushParam
=
new
EKPEntryPushParam
();
...
...
@@ -251,7 +278,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
//推送数据
p
ublic
String
sendToEkp
(
EKPEntryPushParam
pushParam
){
p
rivate
String
sendToEkp
(
EKPEntryPushParam
pushParam
){
RestTemplate
yourRestTemplate
=
new
RestTemplate
();
try
{
String
formValues
=
new
ObjectMapper
().
writeValueAsString
(
pushParam
);
...
...
@@ -287,6 +314,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
@Override
public
R
querybankinfo
()
{
String
privateKey
=
"4d931f6ad4331158fcc4dea23f0d71393328146e40b5f63f197b9f6ad3732f44"
;
...
...
@@ -325,6 +353,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return
R
.
ok
();
}
@Override
public
R
saveIcbcManagerCard
()
{
//应用id 应用方私钥 网关公钥 应用方加密串
String
APP_ID
=
"11000000000000015602"
;
...
...
@@ -437,7 +466,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
p
ublic
void
initValue
(
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
entry
,
p
rivate
void
initValue
(
MybankEnterpriseTradeQhisdResponseV1
.
MybankEnterpriseTradeQhisdResponseRdV1
entry
,
EKPEntryPushParam
pushParam
,
String
bankName
,
String
bankNo
)
throws
ParseException
{
pushParam
.
setFd_recipName
(
entry
.
getRecipName
());
pushParam
.
setFd_recipAccountNo
(
entry
.
getRecipAccountNo
());
...
...
yifu-ekp/yifu-ekp-biz/src/main/resources/mapper/EkpSocialInfoMapper.xml
View file @
0786a586
...
...
@@ -117,9 +117,9 @@
#{sql}
</update>
<!--查询
社保明细信息
-->
<select
id=
"getAllserioNo"
resultType=
"
java.lang.String
"
>
SELECT fd_3b573843db30ce from ekp_79c234bf64d412294f23
<!--查询
当天的所有入账记录数据, 查账号和流水号
-->
<select
id=
"getAllserioNo"
resultType=
"
Map
"
>
SELECT fd_3b573843db30ce
as onlySequence,fd_3b62f3470beb30 as receiveBkNo
from ekp_79c234bf64d412294f23
where DATE_FORMAT(fd_3aa4531d3b86e0, '%Y-%m-%d') between DATE_SUB(curdate(), INTERVAL 1 day) and DATE_ADD(now(), INTERVAL 1 day)
and fd_3b57f8de9df354 = '是'
</select>
...
...
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