longz
2026-04-22 22b3f30587ad0e8e53ca0dd824c045f8118cda04
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java
@@ -17,6 +17,7 @@
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.dao.CarModelMapper;
import com.stylefeng.guns.modular.system.dao.RegionMapper;
import com.stylefeng.guns.modular.system.model.*;
import com.stylefeng.guns.modular.system.model.vo.*;
@@ -79,6 +80,9 @@
    
    @Autowired
    private ICarService carService;
    @Autowired
    private CarModelMapper carModelMapper;
    
    @Resource
    private RegionMapper regionMapper;
@@ -949,6 +953,52 @@
        }
    }
    /**
     * 获取当前司机当前车车型
     * @param request
     * @return
     */
    @ResponseBody
    @PostMapping("/api/driver/queryMyCarModel")
    @ApiOperation(value = "获取当前司机当前车车型(主要用于获取座位数)", tags = {"司机端-个人中心"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil queryMyCarModel(HttpServletRequest request){
        try {
            Integer uid = driverService.getUserIdFormRedis(request);
            if (uid == null) {
                return ResultUtil.tokenErr();
            }
            Driver driver = driverService.selectById(uid);
            Map<String, Object> map = new HashMap<>(4);
            map.put("carId", null);
            map.put("carModelId", null);
            map.put("carModelName", null);
            map.put("seat", null);
            if (driver == null || driver.getCarId() == null) {
                return ResultUtil.success(map);
            }
            Integer carId = driver.getCarId();
            map.put("carId", carId);
            Car car = carService.selectById(carId);
            if (car == null || car.getCarModelId() == null) {
                return ResultUtil.success(map);
            }
            Integer carModelId = car.getCarModelId();
            map.put("carModelId", carModelId);
            CarModel carModel = carModelMapper.selectById(carModelId);
            if (carModel != null) {
                map.put("carModelName", carModel.getName());
                map.put("seat", carModel.getSeat());
            }
            return ResultUtil.success(map);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 更换车辆
@@ -1788,7 +1838,7 @@
                if (fileName == null || "".equals(fileName)) {
                    String appletPath = "pages/home/scanPage/scanPage";
                    //HttpURLConnection httpURLConnection = weChatUtil.getwxacodeunlimit(appletPath, "d=" + driverId + "&k=" + 0, "release",driverId);
                    InputStream inputStream = weChatUtil.getwxacodeunlimit(appletPath, "driverId=" + driverId, "release");
                    InputStream inputStream = weChatUtil.getwxacodeunlimit(appletPath, "driverId=" + driverId, "trial");
                    if (inputStream != null) {
                        File file = FileUtil.writeFromStream(inputStream, new File(filePath + "/" + UUID.randomUUID().toString() + ".png"));
                        HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image");