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 79684c94
authored
Nov 24, 2023
by
Ren Ping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改位置坐标redis key
1 parent
71a7c86f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
project-dispatch/src/main/java/com/dituhui/pea/dispatch/utils/RoadDistanceUtils.java
project-interface/src/main/java/com/dituhui/pea/enums/RedisKeyGroup.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/utils/RoadDistanceUtils.java
View file @
79684c9
...
@@ -13,6 +13,7 @@ import java.util.Map;
...
@@ -13,6 +13,7 @@ import java.util.Map;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.dituhui.pea.dispatch.common.redis.RedisUtil
;
import
com.dituhui.pea.dispatch.common.redis.RedisUtil
;
import
com.dituhui.pea.enums.RedisKeyGroup
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
com.dituhui.pea.dispatch.pojo.Location
;
import
com.dituhui.pea.dispatch.pojo.Location
;
...
@@ -64,7 +65,7 @@ public class RoadDistanceUtils {
...
@@ -64,7 +65,7 @@ public class RoadDistanceUtils {
return
dis
;
return
dis
;
}
else
{
}
else
{
//distanceCache.put(key, distance);
//distanceCache.put(key, distance);
RedisUtil
.
set
(
key
,
distance
);
RedisUtil
.
set
(
key
,
distance
,
3600
*
24
*
7
);
}
}
return
distance
;
return
distance
;
}
else
{
}
else
{
...
@@ -100,7 +101,7 @@ public class RoadDistanceUtils {
...
@@ -100,7 +101,7 @@ public class RoadDistanceUtils {
return
dis
;
return
dis
;
}
else
{
}
else
{
//distanceCache.put(key, distance);
//distanceCache.put(key, distance);
RedisUtil
.
set
(
key
,
distance
);
RedisUtil
.
set
(
key
,
distance
,
3600
*
24
*
7
);
}
}
return
distance
;
return
distance
;
}
else
{
}
else
{
...
@@ -113,7 +114,7 @@ public class RoadDistanceUtils {
...
@@ -113,7 +114,7 @@ public class RoadDistanceUtils {
}
}
public
static
String
getLocationKey
(
Location
from
,
Location
to
,
int
vehicleType
)
{
public
static
String
getLocationKey
(
Location
from
,
Location
to
,
int
vehicleType
)
{
return
convertDoubleToStr
(
from
.
getLongitude
())
+
","
return
RedisKeyGroup
.
locationDistanceKey
+
":"
+
convertDoubleToStr
(
from
.
getLongitude
())
+
","
+
convertDoubleToStr
(
from
.
getLatitude
())
+
";"
+
convertDoubleToStr
(
from
.
getLatitude
())
+
";"
+
convertDoubleToStr
(
to
.
getLongitude
())
+
","
+
convertDoubleToStr
(
to
.
getLongitude
())
+
","
+
convertDoubleToStr
(
to
.
getLatitude
())
+
"|"
+
vehicleType
;
+
convertDoubleToStr
(
to
.
getLatitude
())
+
"|"
+
vehicleType
;
...
...
project-interface/src/main/java/com/dituhui/pea/enums/RedisKeyGroup.java
View file @
79684c9
...
@@ -18,6 +18,11 @@ public enum RedisKeyGroup {
...
@@ -18,6 +18,11 @@ public enum RedisKeyGroup {
/**
/**
* 资源信息
* 资源信息
*/
*/
resourceKey
;
resourceKey
,
/**
* 坐标距离信息
*/
locationDistanceKey
;
}
}
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