Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
e9e206cc
Commit
e9e206cc
authored
Jun 26, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改违章
parent
960d53ae
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
42 deletions
+70
-42
ITrafficViolationsFeign.java
.../xxfc/platform/universal/api/ITrafficViolationsFeign.java
+1
-1
TrafficViolationsController.java
...orm/universal/controller/TrafficViolationsController.java
+40
-29
TrafficViolationsService.java
.../platform/universal/service/TrafficViolationsService.java
+29
-12
No files found.
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/ITrafficViolations
Service
.java
→
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/api/ITrafficViolations
Feign
.java
View file @
e9e206cc
...
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient
(
"xx-third-party"
)
@FeignClient
(
"xx-third-party"
)
@RequestMapping
(
"3p/tv"
)
@RequestMapping
(
"3p/tv"
)
public
interface
ITrafficViolations
Service
{
public
interface
ITrafficViolations
Feign
{
/**
/**
* 获取支持的城市
* 获取支持的城市
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/TrafficViolationsController.java
View file @
e9e206cc
package
com
.
xxfc
.
platform
.
universal
.
controller
;
package
com
.
xxfc
.
platform
.
universal
.
controller
;
import
com.xxfc.platform.universal.api.ITrafficViolationsService
;
import
com.xxfc.platform.universal.model.JuheResult
;
import
com.xxfc.platform.universal.model.JuheResult
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
import
com.xxfc.platform.universal.service.TrafficViolationsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RestController
@RequestMapping
(
"3p/tv"
)
@RequestMapping
(
"3p/tv"
)
public
class
TrafficViolationsController
{
public
class
TrafficViolationsController
{
//implements ITrafficViolationsService {
@Autowired
// @Autowired
TrafficViolationsService
tvService
;
// TrafficViolationsService tvService;
//
/**
// @Override
* 获取支持的城市
// @GetMapping("city")
* @param province
// public JuheResult getCityInfo(String province) {
* @return
// return tvService.getCity(province);
*/
// }
@GetMapping
(
"/city/{province}"
)
//
public
JuheResult
getCityInfo
(
@PathVariable
String
province
)
{
// @Override
return
tvService
.
getCity
(
province
);
// @GetMapping("trafficViolations")
}
// public JuheResult queryTrafficViolations(String city, String hphm, String hpzl, String engineno, String classno) {
// return tvService.queryViolations(city, hphm, hpzl, engineno, classno);
/**
// }
* 违章车辆查询
//
* @param city
// @Override
* @param hphm
// @GetMapping("balance")
* @param hpzl
// public JuheResult getBalance() {
* @param engineno
// return tvService.queryBalance();
* @param classno
// }
* @return
//
*/
// @Override
@GetMapping
(
"trafficViolations"
)
// @GetMapping("carPre")
public
JuheResult
queryTrafficViolations
(
String
city
,
String
hphm
,
String
hpzl
,
String
engineno
,
String
classno
)
{
// public JuheResult carPre(String hphm) {
return
tvService
.
queryViolations
(
city
,
hphm
,
hpzl
,
engineno
,
classno
);
// return tvService.queryCityByHphm(hphm);
}
// }
@GetMapping
(
"balance"
)
public
JuheResult
getBalance
()
{
return
tvService
.
queryBalance
();
}
@GetMapping
(
"/carPre/{hphm}"
)
public
JuheResult
carPre
(
@PathVariable
String
hphm
)
{
return
tvService
.
queryCityByHphm
(
hphm
);
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/TrafficViolationsService.java
View file @
e9e206cc
...
@@ -2,8 +2,11 @@ package com.xxfc.platform.universal.service;
...
@@ -2,8 +2,11 @@ package com.xxfc.platform.universal.service;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.xxfc.platform.universal.model.*
;
import
com.xxfc.platform.universal.model.*
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
org.apache.http.client.methods.HttpGet
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestClientException
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
...
@@ -14,11 +17,11 @@ import java.util.Map;
...
@@ -14,11 +17,11 @@ import java.util.Map;
/**
/**
* 违章查询
* 违章查询
*/
*/
//
@Service
@Service
public
class
TrafficViolationsService
{
public
class
TrafficViolationsService
{
@Value
(
"${juhe.key}"
)
@Value
(
"${juhe.key}"
)
private
String
KEY
;
private
String
CODE
;
//支持的城市
//支持的城市
private
static
final
String
URL_GET_CITY
=
"http://v.juhe.cn/wz/citys?"
+
private
static
final
String
URL_GET_CITY
=
"http://v.juhe.cn/wz/citys?"
+
...
@@ -33,6 +36,12 @@ public class TrafficViolationsService {
...
@@ -33,6 +36,12 @@ public class TrafficViolationsService {
private
static
final
String
URL_CAR_PRE
=
"http://v.juhe.cn/wz/carPre?"
+
private
static
final
String
URL_CAR_PRE
=
"http://v.juhe.cn/wz/carPre?"
+
"hphm={hphm}&key={key}"
;
"hphm={hphm}&key={key}"
;
private
static
final
String
host
=
"https://weizhang.market.alicloudapi.com"
;
private
static
final
String
path
=
"/wz/province"
;
private
static
final
String
method
=
"GET"
;
private
static
final
String
appcode
=
"你自己的AppCode"
;
@Autowired
@Autowired
RestTemplate
restTemplate
;
RestTemplate
restTemplate
;
...
@@ -45,13 +54,21 @@ public class TrafficViolationsService {
...
@@ -45,13 +54,21 @@ public class TrafficViolationsService {
* {"resultcode":"101","reason":"error key","result":null,"error_code":10001}
* {"resultcode":"101","reason":"error key","result":null,"error_code":10001}
*/
*/
public
JuheResult
<
Map
<
String
,
JuheTrafficViolationsProvinceInfo
>>
getCity
(
String
province
)
{
public
JuheResult
<
Map
<
String
,
JuheTrafficViolationsProvinceInfo
>>
getCity
(
String
province
)
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"key"
,
KEY
);
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
paramsMap
.
put
(
"province"
,
province
==
null
?
""
:
province
);
headers
.
put
(
"Authorization"
,
"APPCODE "
+
CODE
);
paramsMap
.
put
(
"dtype"
,
"json"
);
Map
<
String
,
String
>
querys
=
new
HashMap
<
String
,
String
>();
paramsMap
.
put
(
"format"
,
""
);
querys
.
put
(
"type"
,
"JSON"
);
paramsMap
.
put
(
"callback"
,
""
);
return
query
(
URL_GET_CITY
,
paramsMap
);
// Map<String, String> paramsMap = new HashMap<>();
// paramsMap.put("key", KEY);
// paramsMap.put("province", province == null ? "" : province);
// paramsMap.put("dtype", "json");
// paramsMap.put("format", "");
// paramsMap.put("callback", "");
// CertifHttpUtils.doGet(host,path,method,headers,querys);
//// return (URL_GET_CITY, paramsMap);
return
null
;
}
}
/**
/**
...
@@ -66,7 +83,7 @@ public class TrafficViolationsService {
...
@@ -66,7 +83,7 @@ public class TrafficViolationsService {
public
JuheResult
<
JuheTrafficViolationsInfo
>
queryViolations
(
String
city
,
String
hphm
,
String
hpzl
,
public
JuheResult
<
JuheTrafficViolationsInfo
>
queryViolations
(
String
city
,
String
hphm
,
String
hpzl
,
String
engineno
,
String
classno
)
{
String
engineno
,
String
classno
)
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"key"
,
KEY
);
//
paramsMap.put("key", KEY);
paramsMap
.
put
(
"dtype"
,
"json"
);
paramsMap
.
put
(
"dtype"
,
"json"
);
paramsMap
.
put
(
"city"
,
city
);
paramsMap
.
put
(
"city"
,
city
);
paramsMap
.
put
(
"hphm"
,
hphm
);
paramsMap
.
put
(
"hphm"
,
hphm
);
...
@@ -81,7 +98,7 @@ public class TrafficViolationsService {
...
@@ -81,7 +98,7 @@ public class TrafficViolationsService {
*/
*/
public
JuheResult
<
JuheTrafficViolationsBalanceInfo
>
queryBalance
()
{
public
JuheResult
<
JuheTrafficViolationsBalanceInfo
>
queryBalance
()
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"key"
,
KEY
);
paramsMap
.
put
(
"key"
,
CODE
);
paramsMap
.
put
(
"dtype"
,
"json"
);
paramsMap
.
put
(
"dtype"
,
"json"
);
return
query
(
URL_BALANCE
,
paramsMap
);
return
query
(
URL_BALANCE
,
paramsMap
);
}
}
...
@@ -91,7 +108,7 @@ public class TrafficViolationsService {
...
@@ -91,7 +108,7 @@ public class TrafficViolationsService {
*/
*/
public
JuheResult
<
JuheCarPreInfo
>
queryCityByHphm
(
String
hphm
)
{
public
JuheResult
<
JuheCarPreInfo
>
queryCityByHphm
(
String
hphm
)
{
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
Map
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
paramsMap
.
put
(
"key"
,
KEY
);
paramsMap
.
put
(
"key"
,
CODE
);
paramsMap
.
put
(
"hphm"
,
hphm
);
paramsMap
.
put
(
"hphm"
,
hphm
);
return
query
(
URL_CAR_PRE
,
paramsMap
);
return
query
(
URL_CAR_PRE
,
paramsMap
);
}
}
...
...
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