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
c57b51d2
Commit
c57b51d2
authored
Dec 19, 2022
by
胡建龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]完善调整回单下载接口响应解析及文件下载功能
parent
7cef4c6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
PingAnServiceImpl.java
...a/com/hand/app/pingAn/service/impl/PingAnServiceImpl.java
+19
-10
ApiUtils.java
core/src/main/java/com/hand/app/pingAn/utils/ApiUtils.java
+4
-0
No files found.
core/src/main/java/com/hand/app/pingAn/service/impl/PingAnServiceImpl.java
View file @
c57b51d2
...
...
@@ -22,6 +22,7 @@ import com.hand.hap.core.IRequest;
import
com.hand.hap.intergration.dto.HapInterfaceHeader
;
import
com.hand.hap.intergration.service.IHapInterfaceHeaderService
;
import
com.hand.hap.system.dto.ResponseData
;
import
com.pingan.openbank.api.sdk.client.ApiClient
;
import
com.pingan.openbank.api.sdk.common.http.HttpResult
;
import
com.pingan.openbank.api.sdk.entity.*
;
import
org.slf4j.Logger
;
...
...
@@ -75,28 +76,24 @@ public class PingAnServiceImpl implements PingAnService {
if
(
Objects
.
nonNull
(
result
))
{
// 通信成功
if
(
"200"
.
equals
(
result
.
getCode
()
+
""
))
{
// todo 不同接口返回不同数据,需要确认返回结果的格式
JSONObject
res
=
JSONObject
.
parseObject
(
result
.
getData
());
switch
(
interfaceName
)
{
case
"bedl/SubAcctMaintenance"
:
hlsWsRequests
.
setFunctionName
(
"pingAn_SubAcctMaintenance"
);
responseData
.
put
(
"data"
,
res
);
break
;
case
"bedl/InquiryIntoTheCurrentDetailsOfMainSubaccountAccountTwo"
:
hlsWsRequests
.
setFunctionName
(
"pingAn_recentDetailQuery"
);
responseData
.
put
(
"data"
,
res
);
break
;
case
"bedl/DetailReportQueryNew"
:
hlsWsRequests
.
setFunctionName
(
"pingAn_DetailReportQueryNew"
);
//返回数组类型数据,所以
JSONArray
fileArr
=
JSONArray
.
parseArray
(
result
.
getData
());
responseData
.
put
(
"data"
,
fileArr
);
//进行文件下载
dowloadDetailFile
(
res
);
break
;
}
responseData
.
put
(
"data"
,
res
);
// 具体业务是否请求成功判定,目前观察成功请求可能没有Code值
if
(
"000000"
.
equals
(
res
.
getString
(
"Code"
))
||
Objects
.
isNull
(
res
.
getString
(
"Code"
))){
if
(
"bedl/DetailReportQueryNew"
.
equals
(
interfaceName
)){
dowloadDetailFile
(
res
);
}
hlsWsRequests
.
setReturnStatus
(
"s"
);
responseData
.
put
(
Constants
.
RESP_CODE
,
"0000"
);
responseData
.
put
(
"respMsg"
,
"请求成功"
);
...
...
@@ -211,8 +208,20 @@ public class PingAnServiceImpl implements PingAnService {
}
//下载回单文件
private
boolean
dowloadDetailFile
(
JSONObject
data
){
return
true
;
private
void
dowloadDetailFile
(
JSONObject
data
){
JSONArray
arr
=
data
.
getJSONArray
(
"list"
);
//转换成orderFile对象
if
(
Objects
.
nonNull
(
arr
))
{
List
<
OrderFile
>
orderFiles
=
arr
.
toJavaList
(
OrderFile
.
class
);
OrderFileRequest
orderFileRequest
=
new
OrderFileRequest
();
orderFileRequest
.
setDownPath
(
"D:\\download\\yqzl"
);
File
file
=
new
File
(
orderFileRequest
.
getDownPath
());
if
(!
file
.
exists
())
{
file
.
mkdirs
();
}
orderFileRequest
.
setOrderFiles
(
orderFiles
);
ApiUtils
.
getApiClient
().
orderFileDownload
(
orderFileRequest
);
}
}
/**
...
...
core/src/main/java/com/hand/app/pingAn/utils/ApiUtils.java
View file @
c57b51d2
...
...
@@ -37,4 +37,8 @@ public class ApiUtils {
clone
.
put
(
"CnsmrSeqNo"
,
today
+
"000"
);
return
clone
;
}
public
static
ApiClient
getApiClient
(){
return
apiClient
;
}
}
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