Commit c10e3e67 by caiyt

支持测试中的店铺和机器可下单的操作

parent 09788544
...@@ -136,7 +136,7 @@ public class OrderController extends BaseController { ...@@ -136,7 +136,7 @@ public class OrderController extends BaseController {
List<Machine> machines = machineService.selectMachineList(machine); List<Machine> machines = machineService.selectMachineList(machine);
if (machines != null && !machines.isEmpty()) { if (machines != null && !machines.isEmpty()) {
Machine machine1 = machines.get(0); Machine machine1 = machines.get(0);
if (!MachineState.RUNNING.getState().equals(machine1.getState())) { if (!MachineState.RUNNING.getState().equals(machine1.getState()) && !MachineState.TO_BE_TEST.getState().equals(machine1.getState())) {
return AjaxResult.error("机器暂时不可用"); return AjaxResult.error("机器暂时不可用");
} }
String machineId = machine1.getId(); String machineId = machine1.getId();
......
...@@ -225,8 +225,8 @@ public class OrderServiceImpl implements IOrderService { ...@@ -225,8 +225,8 @@ public class OrderServiceImpl implements IOrderService {
if (startBusiness.getTimeInMillis() > l || endBusiness.getTimeInMillis() < l) { if (startBusiness.getTimeInMillis() > l || endBusiness.getTimeInMillis() < l) {
throw new ServiceException("当前时间本店休息中,暂停点单~"); throw new ServiceException("当前时间本店休息中,暂停点单~");
} }
if (!Objects.equals(ShopState.OPEN.getState(), shop.getState())) { if (!Objects.equals(ShopState.OPEN.getState(), shop.getState()) && !Objects.equals(ShopState.TESTING.getState(), shop.getState())) {
throw new ServiceException("店铺非营业状态不能下单"); throw new ServiceException("店铺当前状态不能下单");
} }
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()));
......
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