Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
operating-vehicle
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杜发飞
operating-vehicle
Commits
27c4f5c8
Commit
27c4f5c8
authored
Oct 27, 2019
by
dufafei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
09c081de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/main/scala/com/hikcreate/data/sync/SyncIgnite1.scala
+1
-1
src/main/scala/com/hikcreate/data/util/Tools.scala
+3
-3
No files found.
src/main/scala/com/hikcreate/data/sync/SyncIgnite1.scala
View file @
27c4f5c8
...
...
@@ -50,7 +50,7 @@ object SyncIgnite1 extends Sparking with Logging{
val
lon
=
json
.
getDouble
(
"lon"
)/
1000000
val
lat
=
json
.
getDouble
(
"lat"
)/
1000000
val
dateTime
=
DateTime
.
parse
(
json
.
getString
(
"dateTime"
),
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
))
//定位时间
val
time
=
dateTime
.
toString
(
"yyyy-MM-dd HH:mm:ss"
)
val
time
=
dateTime
.
toString
(
"yyyy-MM-dd HH:mm:ss"
)
val
date
=
dateTime
.
toLocalDate
.
toString
(
"yyyy-MM-dd"
)
val
vehicleInfoOptional
=
Tools
.
getVehicleInfo
(
vehicleNo
,
vehicleColor
)
val
vehicleProvince
=
vehicleInfoOptional
.
map
(
x
=>
x
.
getProvince
).
getOrElse
(
"无"
)
...
...
src/main/scala/com/hikcreate/data/util/Tools.scala
View file @
27c4f5c8
...
...
@@ -73,10 +73,10 @@ object Tools extends Logging{
arr
.
add
(
lonAndLat
)
}
json
.
put
(
"locations"
,
arr
)
val
startTime
=
DateTime
.
now
()
//
val startTime = DateTime.now()
val
response
=
Http
(
Const
.
areaCodeAndAddressUrl
).
postData
(
json
.
toJSONString
).
header
(
"content-type"
,
"application/json"
).
asString
val
endTime
=
DateTime
.
now
()
println
(
"http请求时间:"
+
new
Duration
(
startTime
,
endTime
).
getMillis
)
//
val endTime = DateTime.now()
//println("http请求时间:"+new Duration(startTime,endTime).getMillis/1000
)
val
body
=
JSON
.
parseObject
(
response
.
body
)
val
items
=
body
.
getJSONObject
(
"result"
).
getJSONArray
(
"regeoItems"
)
(
0
until
items
.
size
()).
map
{
index
=>
...
...
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