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
d2454e1c
Commit
d2454e1c
authored
Jun 27, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改违章,把查询到的车型代码和类型保存到数据库2
parent
bd1d4e8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
LicensePlateType.java
.../com/xxfc/platform/universal/entity/LicensePlateType.java
+1
-3
LicensePlateTypeBiz.java
.../com/xxfc/platform/universal/biz/LicensePlateTypeBiz.java
+2
-0
TrafficViolationsController.java
...orm/universal/controller/TrafficViolationsController.java
+1
-1
TrafficViolationsService.java
.../platform/universal/service/TrafficViolationsService.java
+13
-8
No files found.
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/LicensePlateType.java
View file @
d2454e1c
...
...
@@ -47,11 +47,9 @@ public class LicensePlateType implements Serializable {
private
Date
updateDate
;
public
LicensePlateType
(
String
code
,
String
type
,
Date
createDate
)
{
public
LicensePlateType
(
String
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
this
.
createDate
=
createDate
;
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/LicensePlateTypeBiz.java
View file @
d2454e1c
...
...
@@ -5,12 +5,14 @@ import com.xxfc.platform.universal.entity.LicensePlateType;
import
com.xxfc.platform.universal.entity.SearchableCity
;
import
com.xxfc.platform.universal.mapper.LicensePlateTypeMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
@Service
public
class
LicensePlateTypeBiz
extends
BaseBiz
<
LicensePlateTypeMapper
,
LicensePlateType
>
{
@Transactional
public
void
insertLicensePlateType
(
ArrayList
<
LicensePlateType
>
licensePlateTypes
)
{
mapper
.
insertLicensePlateType
(
licensePlateTypes
);
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/TrafficViolationsController.java
View file @
d2454e1c
...
...
@@ -49,7 +49,7 @@ public class TrafficViolationsController {
@GetMapping
(
"/LicensePlateType"
)
public
ObjectRestResponse
getLicensePlateType
()
{
try
{
return
ObjectRestResponse
.
succ
(
JSONObject
.
parse
(
tvService
.
getLicensePlateType
()
));
return
ObjectRestResponse
.
succ
(
tvService
.
getLicensePlateType
(
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ObjectRestResponse
.
createDefaultFail
();
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/TrafficViolationsService.java
View file @
d2454e1c
...
...
@@ -7,12 +7,14 @@ import com.xxfc.platform.universal.biz.SearchableCityBiz;
import
com.xxfc.platform.universal.entity.LicensePlateType
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.vo.TrafficViolations
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.task.TaskExecutor
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
...
...
@@ -94,16 +96,11 @@ public class TrafficViolationsService {
}
/**
* 查询车牌类型
*
* @return
* 放入bean中
* @throws Exception
*
*/
public
void
getLicensePlateType
()
throws
Exception
{
public
void
saveLicensePlateType
()
throws
Exception
{
String
result
=
searchaLicensePlateType
();
if
(
StringUtils
.
isBlank
(
result
))
{
throw
new
BaseException
(
"错误! 查询不到车辆类型"
);
}
...
...
@@ -115,7 +112,7 @@ public class TrafficViolationsService {
}
ArrayList
<
LicensePlateType
>
licensePlateTypes
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
String
>
licensePlateTypeEntry
:
licensePlateTypeMap
.
entrySet
())
{
licensePlateTypes
.
add
(
new
LicensePlateType
(
licensePlateTypeEntry
.
getKey
(),
licensePlateTypeEntry
.
getValue
()
,
new
Date
()
));
licensePlateTypes
.
add
(
new
LicensePlateType
(
licensePlateTypeEntry
.
getKey
(),
licensePlateTypeEntry
.
getValue
()));
}
licensePlateTypeBiz
.
insertLicensePlateType
(
licensePlateTypes
);
}
...
...
@@ -165,4 +162,12 @@ public class TrafficViolationsService {
HttpEntity
entity
=
httpResponse
.
getEntity
();
return
unicodeToString
(
EntityUtils
.
toString
(
entity
));
}
public
ArrayList
<
LicensePlateType
>
getLicensePlateType
()
{
List
<
LicensePlateType
>
licensePlateTypes
=
licensePlateTypeBiz
.
selectListAll
();
if
(
CollectionUtils
.
isEmpty
(
licensePlateTypes
))
{
}
return
null
;
}
}
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