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 d6197e58
authored
Nov 24, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://gitlab.dituhui.com/bsh/project/project
into develop
2 parents
ba3bab87
79684c94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 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-order/src/main/java/com/dituhui/pea/order/controller/OrderCreateController.java
project-dispatch/src/main/java/com/dituhui/pea/dispatch/utils/RoadDistanceUtils.java
View file @
d6197e5
...
...
@@ -13,6 +13,7 @@ import java.util.Map;
import
cn.hutool.core.util.StrUtil
;
import
com.dituhui.pea.dispatch.common.redis.RedisUtil
;
import
com.dituhui.pea.enums.RedisKeyGroup
;
import
org.springframework.stereotype.Component
;
import
com.dituhui.pea.dispatch.pojo.Location
;
...
...
@@ -64,7 +65,7 @@ public class RoadDistanceUtils {
return
dis
;
}
else
{
//distanceCache.put(key, distance);
RedisUtil
.
set
(
key
,
distance
);
RedisUtil
.
set
(
key
,
distance
,
3600
*
24
*
7
);
}
return
distance
;
}
else
{
...
...
@@ -100,7 +101,7 @@ public class RoadDistanceUtils {
return
dis
;
}
else
{
//distanceCache.put(key, distance);
RedisUtil
.
set
(
key
,
distance
);
RedisUtil
.
set
(
key
,
distance
,
3600
*
24
*
7
);
}
return
distance
;
}
else
{
...
...
@@ -113,7 +114,7 @@ public class RoadDistanceUtils {
}
public
static
String
getLocationKey
(
Location
from
,
Location
to
,
int
vehicleType
)
{
return
convertDoubleToStr
(
from
.
getLongitude
())
+
","
return
RedisKeyGroup
.
locationDistanceKey
+
":"
+
convertDoubleToStr
(
from
.
getLongitude
())
+
","
+
convertDoubleToStr
(
from
.
getLatitude
())
+
";"
+
convertDoubleToStr
(
to
.
getLongitude
())
+
","
+
convertDoubleToStr
(
to
.
getLatitude
())
+
"|"
+
vehicleType
;
...
...
project-interface/src/main/java/com/dituhui/pea/enums/RedisKeyGroup.java
View file @
d6197e5
...
...
@@ -18,6 +18,11 @@ public enum RedisKeyGroup {
/**
* 资源信息
*/
resourceKey
;
resourceKey
,
/**
* 坐标距离信息
*/
locationDistanceKey
;
}
project-order/src/main/java/com/dituhui/pea/order/controller/OrderCreateController.java
View file @
d6197e5
...
...
@@ -6,6 +6,7 @@ import com.dituhui.pea.order.dto.param.CapacityQueryDTO;
import
com.dituhui.pea.order.dto.param.OrderDTO
;
import
com.dituhui.pea.order.service.CapacityQueryService
;
import
com.dituhui.pea.order.service.OrderCreateService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -22,6 +23,7 @@ import java.time.ZoneId;
*/
@RestController
@RequestMapping
(
"/pea-order"
)
@Slf4j
public
class
OrderCreateController
{
@Autowired
...
...
@@ -36,6 +38,7 @@ public class OrderCreateController {
try
{
res
=
orderCreateService
.
createOrder
(
orderCreateReqDTO
);
}
catch
(
BusinessException
e
)
{
log
.
error
(
"创建订单失败:"
+
e
.
getMessage
(),
e
);
return
Result
.
failed
(
e
.
getMessage
());
}
return
res
;
...
...
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