Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 42083042
authored
Nov 13, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复坐标为空bug
1 parent
b9959e7d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/controller/PathController.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/utils/RoadDistanceUtils.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/controller/PathController.java
View file @
4208304
...
@@ -58,8 +58,8 @@ public class PathController implements IPath {
...
@@ -58,8 +58,8 @@ public class PathController implements IPath {
}
}
// 获取距离
// 获取距离
Distance
distance
=
roadDistanceUtils
.
getDistance2
(
new
Location
(
0L
,
fromX
,
fromY
),
Distance
distance
=
roadDistanceUtils
.
getDistance2
(
new
Location
(
0L
,
null
,
null
,
fromX
,
fromY
),
new
Location
(
0L
,
toX
,
to
Y
),
vehicleType
);
new
Location
(
0L
,
null
,
null
,
fromX
,
from
Y
),
vehicleType
);
DistanceDTO
dto
=
new
DistanceDTO
();
DistanceDTO
dto
=
new
DistanceDTO
();
dto
.
setDis
(
distance
.
getDis
());
dto
.
setDis
(
distance
.
getDis
());
dto
.
setTime
(
distance
.
getTime
());
dto
.
setTime
(
distance
.
getTime
());
...
...
project-dispatch/src/main/java/com/dituhui/pea/dispatch/utils/RoadDistanceUtils.java
View file @
4208304
...
@@ -13,7 +13,6 @@ import java.util.Map;
...
@@ -13,7 +13,6 @@ import java.util.Map;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.dituhui.pea.dispatch.pojo.Location
;
import
com.dituhui.pea.dispatch.pojo.Location
;
import
com.dituhui.pea.dispatch.service.impl.SolveServiceImpl
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
...
@@ -137,7 +136,7 @@ public class RoadDistanceUtils {
...
@@ -137,7 +136,7 @@ public class RoadDistanceUtils {
}
}
String
text
=
requestGetAK
(
url
,
params
);
String
text
=
requestGetAK
(
url
,
params
);
System
.
out
.
println
(
url
+
" : "
+
gson
.
toJson
(
params
)
+
" : "
+
text
);
//
System.out.println(url + " : " + gson.toJson(params) + " : " + text);
BDResult
webResult
=
gson
.
fromJson
(
text
,
BDResult
.
class
);
BDResult
webResult
=
gson
.
fromJson
(
text
,
BDResult
.
class
);
float
dis
=
webResult
.
getResult
().
get
(
0
).
getDistance
().
getValue
()
/
1000
F
;
float
dis
=
webResult
.
getResult
().
get
(
0
).
getDistance
().
getValue
()
/
1000
F
;
int
time
=
webResult
.
getResult
().
get
(
0
).
getDuration
().
getValue
();
int
time
=
webResult
.
getResult
().
get
(
0
).
getDuration
().
getValue
();
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment