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
8704ffa1
Commit
8704ffa1
authored
Dec 11, 2020
by
汪昱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 金安易-临安区村级小微权力智慧监管平台数据接口
parent
c64f37d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
0 deletions
+112
-0
JAYSmartController.java
.../com/mth/requestsecret/controller/JAYSmartController.java
+112
-0
No files found.
src/main/java/com/mth/requestsecret/controller/JAYSmartController.java
0 → 100644
View file @
8704ffa1
package
com
.
mth
.
requestsecret
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.HashMap
;
/**
* @author wangy
* @version 1.0
* @description: 金安易-临安区村级小微权力智慧监管平台数据接口
* @date 2020/12/11 16:42
*/
@RestController
public
class
JAYSmartController
{
@Autowired
private
RestTemplate
restTemplate
;
private
final
String
host
=
"http://www.laxwql.com:8768"
;
private
final
String
authCode
=
"nXprocFLHaGa9LzRqGA3u"
;
/**
* 获取单位列表
* @return
*/
@PostMapping
(
"/queryUnitList"
)
public
ResponseEntity
queryUnitList
(){
String
url
=
new
StringBuffer
(
host
)
.
append
(
"/queryUnitList.json?authCode="
)
.
append
(
authCode
)
.
append
(
"&apiName=onlyOrganize"
).
toString
();
HttpHeaders
headers
=
new
HttpHeaders
();
HttpEntity
<
HashMap
<
String
,
Object
>>
request
=
new
HttpEntity
<>(
null
,
headers
);
return
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
request
,
String
.
class
);
}
/**
* 根据单位代码获取公开表数据
* @param unitCode 单位代码
* @param year 年(可选)
* @return
*/
@PostMapping
(
"/queryReportDataListByUnitCode"
)
public
ResponseEntity
queryReportDataListByUnitCode
(
String
unitCode
,
String
year
){
String
url
=
new
StringBuffer
(
host
)
.
append
(
"/queryReportDataListByUnitCode.json?authCode="
)
.
append
(
authCode
)
.
append
(
"&unitCode="
).
append
(
unitCode
)
.
append
(
"&year="
).
append
(
null
==
year
?
""
:
year
)
.
append
(
"&apiName=onlyOrganize"
).
toString
();
HttpEntity
<
HashMap
<
String
,
Object
>>
request
=
new
HttpEntity
<>(
null
,
new
HttpHeaders
());
return
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
request
,
String
.
class
);
}
/**
* 根据单位代码获取 村级工程
* @param unitCode 单位代码
* @return
*/
@PostMapping
(
"/villageEngineeringMaster"
)
public
ResponseEntity
villageEngineeringMaster
(
String
unitCode
){
String
url
=
new
StringBuffer
(
host
)
.
append
(
"/villageEngineeringMaster.json?authCode="
)
.
append
(
authCode
)
.
append
(
"&unitCode="
).
append
(
unitCode
).
toString
();
HttpEntity
<
HashMap
<
String
,
Object
>>
request
=
new
HttpEntity
<>(
null
,
new
HttpHeaders
());
return
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
request
,
String
.
class
);
}
/**
* 根据单位代码获取 村级工程 付款情况 表数据
* @param unitCode 单位代码
* @return
*/
@PostMapping
(
"/villageEngineeringDetail"
)
public
ResponseEntity
villageEngineeringDetail
(
String
unitCode
){
String
url
=
new
StringBuffer
(
host
)
.
append
(
"/villageEngineeringDetail.json?authCode="
)
.
append
(
authCode
)
.
append
(
"&unitCode="
).
append
(
unitCode
).
toString
();
HttpEntity
<
HashMap
<
String
,
Object
>>
request
=
new
HttpEntity
<>(
null
,
new
HttpHeaders
());
return
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
request
,
String
.
class
);
}
/**
* 根据单位代码获取 资产资源 处置 表数据
* @param unitCode 单位代码
* @return
*/
@PostMapping
(
"/queryAssetsResourcesList"
)
public
ResponseEntity
queryAssetsResourcesList
(
String
unitCode
){
String
url
=
new
StringBuffer
(
host
)
.
append
(
"/queryAssetsResourcesList.json?authCode="
)
.
append
(
authCode
)
.
append
(
"&unitCode="
).
append
(
unitCode
).
toString
();
HttpEntity
<
HashMap
<
String
,
Object
>>
request
=
new
HttpEntity
<>(
null
,
new
HttpHeaders
());
return
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
request
,
String
.
class
);
}
}
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