Commit 27c4f5c8 by dufafei

1

parent 09c081de
......@@ -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("无")
......
......@@ -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 =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment