Commit d05d57a8 by weijiguang

修复点单屏下单校验地址问题

parent 2ccc540f
...@@ -234,6 +234,9 @@ public class OrderServiceImpl implements IOrderService { ...@@ -234,6 +234,9 @@ public class OrderServiceImpl implements IOrderService {
if (!Objects.equals(ShopState.OPEN.getState(), shop.getState()) && !Objects.equals(ShopState.TESTING.getState(), shop.getState())) { if (!Objects.equals(ShopState.OPEN.getState(), shop.getState()) && !Objects.equals(ShopState.TESTING.getState(), shop.getState())) {
throw new ServiceException("店铺当前状态不能下单"); throw new ServiceException("店铺当前状态不能下单");
} }
try {
if (order.getSource() != null && order.getSource() == 3) {
// 手机下单才校验位置,点单屏下单不校验位置
if (shop.getDistanceLimit() != null && shop.getDistanceLimit() > 0) { 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())); double distance = DistanceUtil.getRealDistance(order.getLng().doubleValue(), order.getLat().doubleValue(), Double.parseDouble(shop.getLng()), Double.parseDouble(shop.getLat()));
if (distance > shop.getDistanceLimit() * 1000) { if (distance > shop.getDistanceLimit() * 1000) {
...@@ -241,6 +244,10 @@ public class OrderServiceImpl implements IOrderService { ...@@ -241,6 +244,10 @@ public class OrderServiceImpl implements IOrderService {
} }
} }
} }
} catch (Exception e) {
throw new ServiceException("未开启微信软件地理位置权限,请前往系统设置中打开");
}
}
/** /**
* 订单重写从这里开始,这里要承担大部分的业务逻辑,逻辑集中化处理 * 订单重写从这里开始,这里要承担大部分的业务逻辑,逻辑集中化处理
......
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