longz
2026-04-22 22b3f30587ad0e8e53ca0dd824c045f8118cda04
新增司机自主行程
3个文件已添加
8个文件已修改
451 ■■■■■ 已修改文件
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/DriverController.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/controller/CrossCityShiftController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/DriverSelfTripMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/DriverSelfTripMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/LineShiftDriverMapper.xml 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/model/LineShiftDriver.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/ILineShiftDriverService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/warpper/AddSelfTripWarpper.java 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/WeChatUtil.java 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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");
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/controller/CrossCityShiftController.java
@@ -7,6 +7,7 @@
import com.stylefeng.guns.modular.crossCity.warpper.LineShiftItemWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.OtherDriverShiftWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.ScanOrderDetailWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.AddSelfTripWarpper;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import io.swagger.annotations.Api;
@@ -20,6 +21,7 @@
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 【202601】城际专线排班控制器
@@ -123,6 +125,37 @@
    }
    /**
     * 【202604】新增司机自主行程
     */
    @ResponseBody
    @PostMapping("/addSelfTrip")
    @ApiOperation(value = "【202604】新增司机自主行程", tags = {"司机端-首页"}, notes = "新增司机自主行程并写入排班主表")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "出发日期(yyyy-MM-dd)", name = "day", required = true, dataType = "String"),
            @ApiImplicitParam(value = "出发时间(HH:mm)", name = "startTime", required = true, dataType = "String"),
            @ApiImplicitParam(value = "座位数", name = "seat", required = true, dataType = "int"),
            @ApiImplicitParam(value = "出发城市编码", name = "startCityCode", required = false, dataType = "String"),
            @ApiImplicitParam(value = "出发城市名称", name = "startCityName", required = false, dataType = "String"),
            @ApiImplicitParam(value = "出发地地址", name = "startAddress", required = true, dataType = "String"),
            @ApiImplicitParam(value = "出发地经度", name = "startLon", required = true, dataType = "double"),
            @ApiImplicitParam(value = "出发地纬度", name = "startLat", required = true, dataType = "double"),
            @ApiImplicitParam(value = "目的地JSON数组(每项需包含endAddress/endLon/endLat/price)", name = "destJson", required = true, dataType = "String"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<Map<String, Object>> addSelfTrip(AddSelfTripWarpper warpper, HttpServletRequest request) {
        try {
            Integer driverId = driverService.getUserIdFormRedis(request);
            if (null == driverId) {
                return ResultUtil.tokenErr();
            }
            return lineShiftDriverService.addSelfTrip(driverId, warpper);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**
     * 验证日期有效性
     * @param dateStr
     * @return
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/DriverSelfTripMapper.java
New file
@@ -0,0 +1,7 @@
package com.stylefeng.guns.modular.crossCity.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.modular.crossCity.model.DriverSelfTrip;
public interface DriverSelfTripMapper extends BaseMapper<DriverSelfTrip> {
}
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/DriverSelfTripMapper.xml
New file
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.stylefeng.guns.modular.crossCity.dao.DriverSelfTripMapper">
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.crossCity.model.DriverSelfTrip">
        <id column="id" property="id"/>
        <result column="driverId" property="driverId"/>
        <result column="day" property="day"/>
        <result column="startTime" property="startTime"/>
        <result column="seat" property="seat"/>
        <result column="startCityCode" property="startCityCode"/>
        <result column="startCityName" property="startCityName"/>
        <result column="startAddress" property="startAddress"/>
        <result column="startLon" property="startLon"/>
        <result column="startLat" property="startLat"/>
        <result column="destJson" property="destJson"/>
        <result column="state" property="state"/>
        <result column="insertTime" property="insertTime"/>
        <result column="updateTime" property="updateTime"/>
    </resultMap>
</mapper>
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/dao/mapping/LineShiftDriverMapper.xml
@@ -13,6 +13,7 @@
        <result column="totalSeat" property="totalSeat"/>
        <result column="inserTime" property="inserTime"/>
        <result column="assignType" property="assignType"/>
        <result column="customerId" property="customerId"/>
    </resultMap>
@@ -26,7 +27,8 @@
        laveSeatNumber as laveSeatNumber,
        totalSeat as totalSeat,
        inserTime as inserTime,
        assignType as assignType
        assignType as assignType,
        customerId as customerId
        from t_line_shift_driver where 1 = 1
        <if test="null != driverId">
            and driverId = #{driverId}
@@ -35,7 +37,7 @@
            and lineShiftId = #{lineShiftId}
        </if>
        <if test="null != time">
            and DATE_FORMAT(`day`, '%Y-%m%-%d') = DATE_FORMAT(#{time}, '%Y-%m%-%d')
            and DATE_FORMAT(`day`, '%Y-%m-%d') = DATE_FORMAT(#{time}, '%Y-%m-%d')
        </if>
        order by `day`
    </select>
@@ -150,6 +152,8 @@
    <!-- 【202604】查询司机本人已领取/被分配的排班列表(今天及之后) -->
    <select id="queryMyDriverShiftList" resultType="java.util.Map">
        SELECT *
        FROM (
        SELECT
            lsd.id as lineShiftDriverId,
            lsd.lineShiftId as lineShiftId,
@@ -172,15 +176,44 @@
            GROUP BY lineShiftDriverId
        ) occ ON occ.lineShiftDriverId = lsd.id
        WHERE lsd.driverId = #{driverId}
              AND lsd.lineShiftId != -1
        <if test="startDate != null and startDate != ''">
          AND lsd.day = CAST(#{startDate} AS DATE)
                  AND lsd.day = #{startDate}
        </if>
        <if test="startDate == null or startDate == ''">
          AND lsd.day &gt;= CURDATE()
        </if>
          AND ls.state = 1
          AND l.state = 1
        ORDER BY lsd.day ASC, ls.startTime ASC, lsd.id ASC
            UNION ALL
            SELECT
                lsd.id as lineShiftDriverId,
                lsd.lineShiftId as lineShiftId,
                lsd.laveSeat as laveSeat,
                lsd.totalSeat as totalSeat,
                st.startTime as startTime,
                st.startTime as endTime,
                '自主行程' as lineName,
                1 as assignType,
                NULL as orderId,
                NULL as orderType,
                DATE_FORMAT(lsd.day, '%Y-%m-%d') as day
            FROM t_line_shift_driver lsd
            INNER JOIN t_driver_self_trip st
                ON st.id = lsd.customerId
               AND st.state = 1
            WHERE lsd.driverId = #{driverId}
              AND lsd.lineShiftId = -1
              <if test="startDate != null and startDate != ''">
                  AND lsd.day = #{startDate}
              </if>
              <if test="startDate == null or startDate == ''">
                  AND lsd.day &gt;= CURDATE()
              </if>
        ) t
        ORDER BY t.day ASC, t.startTime ASC, t.lineShiftDriverId ASC
        LIMIT #{offset}, #{size}
    </select>
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/model/LineShiftDriver.java
@@ -58,6 +58,11 @@
     */
    @TableField("assignType")
    private Integer assignType;
    /**
     * 自主行程详情id
     */
    @TableField("customerId")
    private Integer customerId;
    public Integer getId() {
        return id;
@@ -131,6 +136,14 @@
        this.assignType = assignType;
    }
    public Integer getCustomerId() {
        return customerId;
    }
    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }
    @Override
    public String toString() {
        return "LineShiftDriver{" +
@@ -143,6 +156,7 @@
                ", totalSeat=" + totalSeat +
                ", inserTime=" + inserTime +
                ", assignType=" + assignType +
                ", customerId=" + customerId +
                '}';
    }
}
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/ILineShiftDriverService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver;
import com.stylefeng.guns.modular.crossCity.warpper.AddSelfTripWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.DriverShiftListWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.LineShiftItemWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.OtherDriverShiftWarpper;
@@ -9,6 +10,7 @@
import com.stylefeng.guns.modular.system.util.ResultUtil;
import java.util.List;
import java.util.Map;
public interface ILineShiftDriverService extends IService<LineShiftDriver> {
@@ -50,6 +52,16 @@
     * @throws Exception
     */
    List<OtherDriverShiftWarpper> queryOtherDriverShiftListWithShiftId(Long driverShiftId) throws Exception;
    /**
     * 【202604】新增司机自主行程
     * @param driverId 司机id
     * @param warpper 参数
     * @return lineShiftDriverId、customerId
     * @throws Exception
     */
    ResultUtil<Map<String, Object>> addSelfTrip(Integer driverId, AddSelfTripWarpper warpper) throws Exception;
    /**
     * 【202601】查询班次详情
     * @param lineShiftDriverId 班次id
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/LineShiftDriverServiceImpl.java
@@ -3,13 +3,16 @@
import cn.hutool.core.date.DateUnit;
import cn.hutool.cron.CronUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.crossCity.dao.DriverSelfTripMapper;
import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper;
import com.stylefeng.guns.modular.crossCity.dao.LineShiftDriverMapper;
import com.stylefeng.guns.modular.crossCity.dao.LineShiftMapper;
import com.stylefeng.guns.modular.crossCity.model.DriverSelfTrip;
import com.stylefeng.guns.modular.crossCity.model.LineShift;
import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
@@ -17,6 +20,7 @@
import com.stylefeng.guns.modular.crossCity.server.ILineShiftDriverService;
import com.stylefeng.guns.modular.crossCity.server.ILineSiteService;
import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService;
import com.stylefeng.guns.modular.crossCity.warpper.AddSelfTripWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.DriverShiftListWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.LineShiftItemWarpper;
import com.stylefeng.guns.modular.crossCity.warpper.OtherDriverShiftWarpper;
@@ -24,17 +28,23 @@
import com.stylefeng.guns.modular.system.dao.CarModelMapper;
import com.stylefeng.guns.modular.system.dao.CarServiceMapper;
import com.stylefeng.guns.modular.system.dao.ServerCarModelMapper;
import com.stylefeng.guns.modular.system.model.Car;
import com.stylefeng.guns.modular.system.model.CarModel;
import com.stylefeng.guns.modular.system.model.CarService;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.service.ICarService;
import com.stylefeng.guns.modular.system.service.IDriverService;
import com.stylefeng.guns.modular.system.util.DateUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.*;
import java.util.stream.Collectors;
@@ -65,6 +75,9 @@
    @Resource
    private CarServiceMapper carServiceMapper;
    @Resource
    private DriverSelfTripMapper driverSelfTripMapper;
    @Autowired
    private IOrderCrossCityService orderCrossCityService;
@@ -442,11 +455,155 @@
        if (driverShiftId == null) {
            return new ArrayList<>();
        }
        LineShiftDriver current = lineShiftDriverMapper.selectById(driverShiftId);
        if (current == null || (current.getLineShiftId() != null && current.getLineShiftId() == -1)) {
            return new ArrayList<>();
        }
        List<Map<String, Object>> rows = lineShiftDriverMapper.queryOtherDriverShiftListWithShiftId(driverShiftId);
        return OtherDriverShiftWarpper.fromMaps(rows);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public ResultUtil<Map<String, Object>> addSelfTrip(Integer driverId, AddSelfTripWarpper warpper) throws Exception {
        if (driverId == null) {
            return ResultUtil.tokenErr();
        }
        if (warpper == null) {
            return ResultUtil.paranErr();
        }
        if (!isSelfTripEnabled(driverId)) {
            return ResultUtil.error("未开启自主行程");
        }
        if (ToolUtil.isEmpty(warpper.getDay()) || ToolUtil.isEmpty(warpper.getStartTime())
                || warpper.getSeat() == null
                || ToolUtil.isEmpty(warpper.getStartAddress())
                || warpper.getStartLon() == null
                || warpper.getStartLat() == null
                || ToolUtil.isEmpty(warpper.getDestJson())) {
            return ResultUtil.paranErr();
        }
        LocalDate day;
        try {
            day = LocalDate.parse(warpper.getDay(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        } catch (DateTimeParseException e) {
            return ResultUtil.error("出发日期格式错误");
        }
        LocalDate today = LocalDate.now();
        if (day.isBefore(today)) {
            return ResultUtil.error("日期不能早于今天");
        }
        if (day.isAfter(today.plusDays(6))) {
            return ResultUtil.error("只能新增7天内的自主行程");
        }
        if (!warpper.getStartTime().matches("^([01]\\d|2[0-3]):[0-5]\\d$")) {
            return ResultUtil.error("出发时间格式错误");
        }
        Integer carSeat = getCurrentCarSeat(driverId);
        if (carSeat == null || carSeat <= 0) {
            return ResultUtil.error("当前车辆车型座位数异常");
        }
        if (warpper.getSeat() < 1 || warpper.getSeat() > carSeat) {
            return ResultUtil.error("座位数超出当前车型可用范围");
        }
        String normalizedDestJson = validateAndNormalizeDestJson(warpper.getDestJson());
        if (normalizedDestJson == null) {
            return ResultUtil.error("目的地信息格式不正确");
        }
        DriverSelfTrip trip = new DriverSelfTrip();
        trip.setDriverId(driverId);
        trip.setDay(java.sql.Date.valueOf(day));
        trip.setStartTime(warpper.getStartTime());
        trip.setSeat(warpper.getSeat());
        trip.setStartCityCode(warpper.getStartCityCode());
        trip.setStartCityName(warpper.getStartCityName());
        trip.setStartAddress(warpper.getStartAddress());
        trip.setStartLon(warpper.getStartLon());
        trip.setStartLat(warpper.getStartLat());
        trip.setDestJson(normalizedDestJson);
        trip.setState(1);
        trip.setInsertTime(new Date());
        trip.setUpdateTime(new Date());
        driverSelfTripMapper.insert(trip);
        LineShiftDriver lineShiftDriver = new LineShiftDriver();
        lineShiftDriver.setLineShiftId(-1);
        lineShiftDriver.setCustomerId(trip.getId());
        lineShiftDriver.setDriverId(driverId);
        lineShiftDriver.setDay(java.sql.Date.valueOf(day));
        lineShiftDriver.setLaveSeat(warpper.getSeat());
        lineShiftDriver.setTotalSeat(warpper.getSeat());
        lineShiftDriver.setLaveSeatNumber(buildSeatNumber(warpper.getSeat()));
        lineShiftDriver.setInserTime(new Date());
        lineShiftDriver.setAssignType(1);
        lineShiftDriverMapper.insert(lineShiftDriver);
        Map<String, Object> result = new HashMap<>(2);
        result.put("lineShiftDriverId", lineShiftDriver.getId());
        result.put("customerId", trip.getId());
        return ResultUtil.success(result);
    }
    private boolean isSelfTripEnabled(Integer driverId) throws Exception {
        Map<String, Object> info = driverService.queryInfo(driverId);
        Object value = info == null ? null : info.get("isOpenDriverSelfTrip");
        return value != null && "1".equals(String.valueOf(value));
    }
    private Integer getCurrentCarSeat(Integer driverId) {
        Driver driver = driverService.selectById(driverId);
        if (driver == null || driver.getCarId() == null) {
            return null;
        }
        Car car = carService.selectById(driver.getCarId());
        if (car == null || car.getCarModelId() == null) {
            return null;
        }
        CarModel carModel = carModelMapper.selectById(car.getCarModelId());
        return carModel == null ? null : carModel.getSeat();
    }
    private String validateAndNormalizeDestJson(String destJson) {
        try {
            JSONArray array = JSON.parseArray(destJson);
            if (array == null || array.isEmpty()) {
                return null;
            }
            for (int i = 0; i < array.size(); i++) {
                JSONObject item = array.getJSONObject(i);
                if (item == null) {
                    return null;
                }
                String endAddress = item.getString("endAddress");
                Double endLon = item.getDouble("endLon");
                Double endLat = item.getDouble("endLat");
                Double price = item.getDouble("price");
                if (ToolUtil.isEmpty(endAddress) || endLon == null || endLat == null || price == null || price < 0) {
                    return null;
                }
            }
            return array.toJSONString();
        } catch (Exception e) {
            return null;
        }
    }
    private String buildSeatNumber(Integer seat) {
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i <= seat; i++) {
            if (i > 1) {
                sb.append(",");
            }
            sb.append(i);
        }
        return sb.toString();
    }
    @Override
    public ResultUtil<ScanOrderDetailWarpper> getDetail(Integer lineShiftDriverId) {
        // 1. 查询基础数据
        Map<String, Object> data = lineShiftDriverMapper.getDetail(lineShiftDriverId);
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/warpper/AddSelfTripWarpper.java
New file
@@ -0,0 +1,107 @@
package com.stylefeng.guns.modular.crossCity.warpper;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel("新增自主行程参数")
public class AddSelfTripWarpper {
    @ApiModelProperty("出发日期(yyyy-MM-dd)")
    private String day;
    @ApiModelProperty("出发时间(HH:mm)")
    private String startTime;
    @ApiModelProperty("座位数")
    private Integer seat;
    @ApiModelProperty("出发城市编码")
    private String startCityCode;
    @ApiModelProperty("出发城市名称")
    private String startCityName;
    @ApiModelProperty("出发地地址")
    private String startAddress;
    @ApiModelProperty("出发地经度")
    private Double startLon;
    @ApiModelProperty("出发地纬度")
    private Double startLat;
    @ApiModelProperty("目的地JSON数组(每项需包含endAddress/endLon/endLat/price)")
    private String destJson;
    public String getDay() {
        return day;
    }
    public void setDay(String day) {
        this.day = day;
    }
    public String getStartTime() {
        return startTime;
    }
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
    public Integer getSeat() {
        return seat;
    }
    public void setSeat(Integer seat) {
        this.seat = seat;
    }
    public String getStartCityCode() {
        return startCityCode;
    }
    public void setStartCityCode(String startCityCode) {
        this.startCityCode = startCityCode;
    }
    public String getStartCityName() {
        return startCityName;
    }
    public void setStartCityName(String startCityName) {
        this.startCityName = startCityName;
    }
    public String getStartAddress() {
        return startAddress;
    }
    public void setStartAddress(String startAddress) {
        this.startAddress = startAddress;
    }
    public Double getStartLon() {
        return startLon;
    }
    public void setStartLon(Double startLon) {
        this.startLon = startLon;
    }
    public Double getStartLat() {
        return startLat;
    }
    public void setStartLat(Double startLat) {
        this.startLat = startLat;
    }
    public String getDestJson() {
        return destJson;
    }
    public void setDestJson(String destJson) {
        this.destJson = destJson;
    }
}
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/CarServiceImpl.java
@@ -51,6 +51,7 @@
        Integer carId = driver.getCarId();
        map.put("car", "");
        map.put("carModel", "");
        map.put("id", carId);
        if(carId!=null){
            Car car = carMapper.selectById(carId);
@@ -58,6 +59,7 @@
                CarBrand carBrand = carBrandMapper.selectById(car.getCarBrandId());
                CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                map.put("car", car.getCarLicensePlate()+"-" + carBrand.getName() +carModel.getName()+ " " + car.getCarColor());
                map.put("carModel", carModel.getName());
            }
        }
DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/WeChatUtil.java
@@ -23,9 +23,9 @@
@Component
public class WeChatUtil {
    private String wxAppletsAppid="wx20301e30167d920e";
    private String wxAppletsAppid="wxccaecee088db18d5";
    private String wxAppletsAppSecret="4b8fe5cea20c4309fa996caa06ac9b4c";
    private String wxAppletsAppSecret="c02390b36817fae7ccd27f084dfbd294";
    @Autowired
    private RestTemplate restTemplate;