Commit d6a97012 by weijiguang

下单时校验订单中sku数量

parent 770c75ff
...@@ -109,7 +109,7 @@ public class WeixinController { ...@@ -109,7 +109,7 @@ public class WeixinController {
boolean testFlag = false; boolean testFlag = false;
if (loginUser != null) { if (loginUser != null) {
Customer customer = customerService.selectCustById(loginUser.getOpenId()); Customer customer = customerService.selectCustById(loginUser.getOpenId());
if(customer!=null) { if (customer != null) {
testFlag = customer.getTestFlag(); testFlag = customer.getTestFlag();
} }
} }
...@@ -123,7 +123,7 @@ public class WeixinController { ...@@ -123,7 +123,7 @@ public class WeixinController {
boolean testFlag = false; boolean testFlag = false;
if (loginUser != null) { if (loginUser != null) {
Customer customer = customerService.selectCustById(loginUser.getOpenId()); Customer customer = customerService.selectCustById(loginUser.getOpenId());
if(customer!=null) { if (customer != null) {
testFlag = customer.getTestFlag(); testFlag = customer.getTestFlag();
} }
} }
......
...@@ -95,13 +95,15 @@ public class AppServiceImpl { ...@@ -95,13 +95,15 @@ public class AppServiceImpl {
} }
// 超出最大配送距离10KM 或 超出店铺设置最大距离 // 超出最大配送距离10KM 或 超出店铺设置最大距离
double realDistance = DistanceUtil.getRealDistance(Double.parseDouble(lng), Double.parseDouble(lat), Double.parseDouble(shop.getLng()), Double.parseDouble(shop.getLat())); if (!StringUtils.isEmpty(lng) && !StringUtils.isEmpty(lat)) {
double realKm = realDistance / 1000; double realDistance = DistanceUtil.getRealDistance(Double.parseDouble(lng), Double.parseDouble(lat), Double.parseDouble(shop.getLng()), Double.parseDouble(shop.getLat()));
double shopLimit = shop.getDistanceLimit() == null ? 0 : shop.getDistanceLimit(); double realKm = realDistance / 1000;
if (realKm > 10 || realKm > shopLimit) { double shopLimit = shop.getDistanceLimit() == null ? 0 : shop.getDistanceLimit();
shop.setOrderState(0); if (realKm > 10 || realKm > shopLimit) {
shop.setStateDesc("距离较远,门店暂停接单"); shop.setOrderState(0);
return false; shop.setStateDesc("距离较远,门店暂停接单");
return false;
}
} }
shop.setOrderState(1); shop.setOrderState(1);
......
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