Pu Zhibing
2026-01-12 bd1bf2bde1db1b2349104808a9214245256784e8
ManagementQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/general/TDriverController.java
@@ -106,7 +106,9 @@
    
    @Autowired
    private ShiroExtUtil shiroExtUtil;
    @Autowired
    private IDriverWorkService iDriverWorkService;
    /**
     * 跳转投诉页面
     *
@@ -778,6 +780,10 @@
    public Object selectCarOpt(Integer tDriverId,Integer carId) {
        if (SinataUtil.isNotEmpty(tDriverId) && SinataUtil.isNotEmpty(carId)){
            TDriver tDriver = tDriverService.selectById(tDriverId);
            DriverWork driverWork = iDriverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", tDriverId).eq("state", 1));
            if(null != driverWork && !tDriver.getCarId().equals(carId)){
                throw new RuntimeException("司机上班中,不能更换车辆");
            }
            tDriver.setCarId(carId);
            tDriverService.updateById(tDriver);
        }