Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b59fb88a
authored
Jul 12, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: 返回报文的异常处理
1 parent
9db5a71b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
project-order/src/main/java/com/dituhui/pea/order/common/SaasUtils.java
project-order/src/main/java/com/dituhui/pea/order/common/SaasUtils.java
View file @
b59fb88
...
@@ -63,19 +63,21 @@ public class SaasUtils {
...
@@ -63,19 +63,21 @@ public class SaasUtils {
log
.
info
(
"after call saas ==> {}"
,
responseEntity
.
getBody
());
log
.
info
(
"after call saas ==> {}"
,
responseEntity
.
getBody
());
// 使用Jackson库解析JSON数据
// 使用Jackson库解析JSON数据
List
<
BlockInfo
>
blocks
=
new
ArrayList
<>();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
try
{
try
{
List
<
BlockInfo
>
blocks
=
new
ArrayList
<>();
JsonNode
responseJson
=
objectMapper
.
readTree
(
responseBody
);
JsonNode
responseJson
=
objectMapper
.
readTree
(
responseBody
);
// 获取areaResults[0]的值
// 获取areaResults[0]的值
for
(
JsonNode
r
:
responseJson
.
get
(
"result"
).
get
(
0
).
get
(
"areaResults"
))
{
for
(
JsonNode
r
:
responseJson
.
get
(
"result"
).
get
(
0
).
get
(
"areaResults"
))
{
// 分单接口暂时无图层返回
// 分单接口暂时无图层返回
if
(
r
.
get
(
"field3"
)
!=
null
&&
r
.
get
(
"field1"
)
!=
null
)
{
blocks
.
add
(
new
BlockInfo
().
setBlockId
(
r
.
get
(
"field3"
).
asText
()).
setBlockName
(
r
.
get
(
"field1"
).
asText
()));
blocks
.
add
(
new
BlockInfo
().
setBlockId
(
r
.
get
(
"field3"
).
asText
()).
setBlockName
(
r
.
get
(
"field1"
).
asText
()));
}
}
return
blocks
;
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
return
null
;
log
.
error
(
e
.
getMessage
())
;
}
}
return
blocks
;
}
}
public
List
<
String
>
queryBlockIds
(
String
location
,
String
address
)
{
public
List
<
String
>
queryBlockIds
(
String
location
,
String
address
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment