Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
ms
soss
Commits
d05d57a8
Commit
d05d57a8
authored
Mar 28, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复点单屏下单校验地址问题
parent
2ccc540f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
soss-system/src/main/java/com/soss/system/service/impl/OrderServiceImpl.java
+11
-4
No files found.
soss-system/src/main/java/com/soss/system/service/impl/OrderServiceImpl.java
View file @
d05d57a8
...
...
@@ -234,11 +234,18 @@ public class OrderServiceImpl implements IOrderService {
if
(!
Objects
.
equals
(
ShopState
.
OPEN
.
getState
(),
shop
.
getState
())
&&
!
Objects
.
equals
(
ShopState
.
TESTING
.
getState
(),
shop
.
getState
()))
{
throw
new
ServiceException
(
"店铺当前状态不能下单"
);
}
if
(
shop
.
getDistanceLimit
()
!=
null
&&
shop
.
getDistanceLimit
()
>
0
)
{
double
distance
=
DistanceUtil
.
getRealDistance
(
order
.
getLng
().
doubleValue
(),
order
.
getLat
().
doubleValue
(),
Double
.
parseDouble
(
shop
.
getLng
()),
Double
.
parseDouble
(
shop
.
getLat
()));
if
(
distance
>
shop
.
getDistanceLimit
()
*
1000
)
{
throw
new
ServiceException
(
"超过店铺下单的距离范围"
);
try
{
if
(
order
.
getSource
()
!=
null
&&
order
.
getSource
()
==
3
)
{
// 手机下单才校验位置,点单屏下单不校验位置
if
(
shop
.
getDistanceLimit
()
!=
null
&&
shop
.
getDistanceLimit
()
>
0
)
{
double
distance
=
DistanceUtil
.
getRealDistance
(
order
.
getLng
().
doubleValue
(),
order
.
getLat
().
doubleValue
(),
Double
.
parseDouble
(
shop
.
getLng
()),
Double
.
parseDouble
(
shop
.
getLat
()));
if
(
distance
>
shop
.
getDistanceLimit
()
*
1000
)
{
throw
new
ServiceException
(
"超过店铺下单的距离范围"
);
}
}
}
}
catch
(
Exception
e
)
{
throw
new
ServiceException
(
"未开启微信软件地理位置权限,请前往系统设置中打开"
);
}
}
...
...
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