Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jiwei-api
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
马天浩
jiwei-api
Commits
c4dfa4b6
Commit
c4dfa4b6
authored
Sep 21, 2020
by
张欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
救助信息接口xml转json
parent
a9966def
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
RequestController.java
...a/com/mth/requestsecret/controller/RequestController.java
+31
-2
No files found.
src/main/java/com/mth/requestsecret/controller/RequestController.java
View file @
c4dfa4b6
package
com
.
mth
.
requestsecret
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mth.requestsecret.vo.shuguanjuvo.*
;
import
com.mth.requestsecret.service.RestTemplateService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.dom4j.DocumentException
;
import
org.json.XML
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 纪委智慧监督平台接口
*
...
...
@@ -16,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020/7/13
*/
@RestController
@Slf4j
public
class
RequestController
{
@Autowired
...
...
@@ -1026,15 +1035,35 @@ public class RequestController {
* @return
*/
@PostMapping
(
"/dUzfwd0e86Z00oc4"
)
public
ResponseEntity
<
String
>
dUzfwd0e86Z00oc4
(
BaseParamVO
param
)
{
public
ResponseEntity
<
String
>
dUzfwd0e86Z00oc4
(
BaseParamVO
param
)
throws
DocumentException
{
// api签名
String
apiMethod
=
"dUzfwd0e86Z00oc4.action"
;
// api参数
MultiValueMap
<
String
,
Object
>
paramMap
=
new
LinkedMultiValueMap
<>();
paramMap
.
add
(
"dsfz"
,
param
.
getIdCard
());
paramMap
.
add
(
"additional"
,
param
.
getAdditional
());
return
restTemplateService
.
commonSendRequest
(
paramMap
,
apiMethod
);
ResponseEntity
<
String
>
responseEntity
=
restTemplateService
.
commonSendRequest
(
paramMap
,
apiMethod
);
String
body
=
responseEntity
.
getBody
();
log
.
info
(
"救助信息接口responseEntity的body为:"
+
body
);
JSONObject
jObject1
=
JSONObject
.
parseObject
(
body
);
if
(
jObject1
!=
null
){
String
datas1
=
jObject1
.
get
(
"datas"
).
toString
();
log
.
info
(
"救助信息接口外层datas为:"
+
datas1
);
JSONObject
jSONObject2
=
JSONObject
.
parseObject
(
datas1
);
if
(
jSONObject2
!=
null
){
String
tempDatas2
=
jSONObject2
.
get
(
"datas"
).
toString
();
log
.
info
(
"救助信息接口里层datas为:"
+
tempDatas2
);
org
.
json
.
JSONObject
xmlJSONObj
=
XML
.
toJSONObject
(
tempDatas2
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
HttpHeaders
.
CONTENT_TYPE
,
MediaType
.
APPLICATION_JSON_VALUE
)
.
body
(
xmlJSONObj
.
toString
());
}
}
return
responseEntity
;
}
/**
* 六十一.浙江杭州国土局不动产权属证书信息查询
...
...
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