puzhibing
2023-02-24 1f0899504f54bae20c19122b4fde82523235233b
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/OrderServiceImpl.java
@@ -15,6 +15,7 @@
import com.supersavedriving.driver.modular.system.util.mongodb.model.Location;
import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper;
import com.supersavedriving.driver.modular.system.warpper.HallOrderList;
import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.geo.Circle;
import org.springframework.data.geo.Distance;
@@ -103,13 +104,15 @@
         * 司机上线且空闲,下单直接给当前司机,其余进大厅
         * 司机下的订单不需要创建新用户,且只能走线下支付
         */
        int count = this.selectCount(new EntityWrapper<Order>().eq("userPhone", addOrderWarpper.getPhone()).eq("status", 1).in("state", Arrays.asList(101, 102, 103, 104, 105, 106, 201)));
        if(count > 0){
            return ResultUtil.error("该用户还有未完成的订单");
        }
        Driver driver = driverService.selectById(uid);
        DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", uid).eq("status", 1));
        if(null == driverWork){
            return ResultUtil.error("请先上班");
        }
        Order order1 = this.selectOne(new EntityWrapper<Order>().eq("driverId", uid).eq("status", 1).in("state", Arrays.asList(102, 103, 104, 105, 201)));
        Order order = new Order();
        if(driverWork != null && null == order1){
@@ -572,4 +575,10 @@
        }
        return ResultUtil.success();
    }
    @Override
    public OrderInfoWarpper queryOrderInfo(Long orderId) throws Exception {
        return null;
    }
}