liujie
6 天以前 729a5a0592cac7750e8b476c5fcb25bfc3ff8d25
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -4,15 +4,13 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper;
import com.stylefeng.guns.modular.crossCity.warpper.OrderWarpper;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.system.dao.DriverWorkMapper;
import com.stylefeng.guns.modular.system.model.DriverWork;
import com.stylefeng.guns.modular.system.model.Reassign;
import com.stylefeng.guns.modular.system.model.SysTimeoutMoney;
import com.stylefeng.guns.modular.system.model.TimeOutAppeal;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.ChinaMobileUtil;
import com.stylefeng.guns.modular.system.util.PushUtil;
@@ -62,6 +60,13 @@
    @Resource
    private DriverWorkMapper driverWorkMapper;
    @Autowired
    private ISysTimeoutMoneyService sysTimeoutMoneyService;
    @Autowired
    private IOpenCityService openCityService;
    @Autowired
    private ICarService carService;
@@ -257,6 +262,18 @@
            if(null == driverWork1){
                return ResultUtil.error("您已下班,无法接单");
            }
            Driver driver = driverService.selectById(uid);
            //判断车辆是否正在使用中
            Car car = carService.selectById(driver.getCarId());
            if(car.getUseDriverId() != null && !car.getUseDriverId().equals(uid)){
                return ResultUtil.error("当前绑定车辆正在使用中,请更换车辆");
            }else if(car.getUseDriverId()==null){
                car.setUseDriverId(uid);
                carService.updateById(car);
            }
            return orderService.grabOrder(orderId, orderType, uid);
        }catch (Exception e){
            e.printStackTrace();
@@ -265,8 +282,7 @@
    }
    @Autowired
    private ISysTimeoutMoneyService sysTimeoutMoneyService;
    /**
     * 获取服务中页面订单详情
@@ -291,8 +307,8 @@
            Map<String, Object> map = orderService.queryOrderInfo(uid, orderId, orderType);
            if (orderType == 4 || orderType == 5){
                SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null);
                OpenCity openCity = openCityService.openCity1(map.get("startLon").toString(), map.get("startLat").toString());
                SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(new EntityWrapper<SysTimeoutMoney>().eq("openCityId", openCity.getId()));
                map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString()));
                map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用");
@@ -311,7 +327,6 @@
                }
            }
            return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
            //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map));
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
@@ -335,8 +350,8 @@
            Map<String, Object> map = orderService.queryOrderInfo(uid, orderId, 7);
            if (orderType == 4 || orderType == 5){
                SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null);
                OpenCity openCity = openCityService.openCity1(map.get("startLon").toString(), map.get("startLat").toString());
                SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(new EntityWrapper<SysTimeoutMoney>().eq("openCityId", openCity.getId()));
                map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString()));
                map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用");