| | |
| | | @ApiImplicitParam(value = "乘车人数", name = "peopleNumber", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "出行方式(1=拼车,2=包车)", name = "travelMode", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "线路id", name = "lineId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "线路目的地id", name = "lineDestinationId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "服务车型id", name = "serverCarModelId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆总座位数", name = "totalSeat", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "座位编号(1,3,4)", name = "seatNumber", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil queryOrderMoney(String startLonLat, String endLonLat, Integer peopleNumber, Integer travelMode, |
| | | Integer lineId, Integer serverCarModelId, Integer totalSeat, String seatNumber){ |
| | | Integer lineId, Integer lineDestinationId, Integer serverCarModelId, Integer totalSeat, String seatNumber){ |
| | | try { |
| | | return orderCrossCityService.queryOrderMoney(startLonLat, endLonLat, peopleNumber, travelMode, lineId, serverCarModelId, totalSeat, seatNumber); |
| | | return orderCrossCityService.queryOrderMoney(startLonLat, endLonLat, peopleNumber, travelMode, lineId, lineDestinationId, serverCarModelId, totalSeat, seatNumber); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | <result column="serverCarModelId" property="serverCarModelId"/> |
| | | <result column="driverId" property="driverId"/> |
| | | <result column="lineId" property="lineId"/> |
| | | <result column="lineDestinationId" property="lineDestinationId"/> |
| | | <result column="lineShiftDriverId" property="lineShiftDriverId"/> |
| | | <result column="carId" property="carId"/> |
| | | <result column="orderNum" property="orderNum"/> |
| | |
| | | serverCarModelId as serverCarModelId, |
| | | driverId as driverId, |
| | | lineId as lineId, |
| | | lineDestinationId as lineDestinationId, |
| | | lineShiftDriverId as lineShiftDriverId, |
| | | carId as carId, |
| | | orderNum as orderNum, |
| | |
| | | serverCarModelId as serverCarModelId, |
| | | driverId as driverId, |
| | | lineId as lineId, |
| | | lineDestinationId as lineDestinationId, |
| | | lineShiftDriverId as lineShiftDriverId, |
| | | carId as carId, |
| | | orderNum as orderNum, |
| | |
| | | serverCarModelId as serverCarModelId, |
| | | driverId as driverId, |
| | | lineId as lineId, |
| | | lineDestinationId as lineDestinationId, |
| | | lineShiftDriverId as lineShiftDriverId, |
| | | carId as carId, |
| | | orderNum as orderNum, |
| | |
| | | serverCarModelId as serverCarModelId, |
| | | driverId as driverId, |
| | | lineId as lineId, |
| | | lineDestinationId as lineDestinationId, |
| | | lineShiftDriverId as lineShiftDriverId, |
| | | carId as carId, |
| | | orderNum as orderNum, |
| | |
| | | a.serverCarModelId as serverCarModelId, |
| | | a.driverId as driverId, |
| | | a.lineId as lineId, |
| | | a.lineDestinationId as lineDestinationId, |
| | | a.lineShiftDriverId as lineShiftDriverId, |
| | | a.carId as carId, |
| | | a.orderNum as orderNum, |
| | |
| | | boardingLat |
| | | from t_order_cross_city where userId = #{uid} and state in (8, 9) order by insertTime desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | @TableField("lineId") |
| | | private Integer lineId; |
| | | /** |
| | | * 线路目的地id |
| | | */ |
| | | @TableField("lineDestinationId") |
| | | private Integer lineDestinationId; |
| | | /** |
| | | * 预约班次的id |
| | | */ |
| | | @TableField("lineShiftDriverId") |
| | |
| | | |
| | | public void setLineId(Integer lineId) { |
| | | this.lineId = lineId; |
| | | } |
| | | |
| | | public Integer getLineDestinationId() { |
| | | return lineDestinationId; |
| | | } |
| | | |
| | | public void setLineDestinationId(Integer lineDestinationId) { |
| | | this.lineDestinationId = lineDestinationId; |
| | | } |
| | | |
| | | public Integer getLineShiftDriverId() { |
| | |
| | | ", serverCarModelId=" + serverCarModelId + |
| | | ", driverId=" + driverId + |
| | | ", lineId=" + lineId + |
| | | ", lineDestinationId=" + lineDestinationId + |
| | | ", lineShiftDriverId=" + lineShiftDriverId + |
| | | ", carId=" + carId + |
| | | ", orderNum='" + orderNum + '\'' + |
| | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.controller.AppOrderController; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LineMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.crossCity.model.Line; |
| | |
| | | |
| | | @Resource |
| | | private LinePriceMapper linePriceMapper; |
| | | |
| | | @Resource |
| | | private LineMapper lineMapper; |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil queryOrderMoney(String startLonLat, String endLonLat, Integer peopleNumber, Integer travelMode, Integer lineId, |
| | | Integer serverCarModelId, Integer totalSeat, String seatNumber) throws Exception { |
| | | Integer lineDestinationId, Integer serverCarModelId, Integer totalSeat, String seatNumber) throws Exception { |
| | | if (lineDestinationId != null) { |
| | | Map<String, Object> destination = lineMapper.queryLineDestinationById(lineDestinationId, lineId); |
| | | if (destination == null) { |
| | | return ResultUtil.error("目的地不存在"); |
| | | } |
| | | Object priceObj = (totalSeat != null && totalSeat <= 5) ? destination.get("price5") : destination.get("price7"); |
| | | if (priceObj == null) { |
| | | return ResultUtil.error("目的地价格未配置"); |
| | | } |
| | | double unitPrice = Double.valueOf(String.valueOf(priceObj)); |
| | | double totalPrice = new BigDecimal(unitPrice).multiply(new BigDecimal(peopleNumber)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("distance", 0); |
| | | map.put("price", totalPrice); |
| | | return ResultUtil.success(map); |
| | | } |
| | | // TODO: 2023/11/4 无法修改 |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(startLonLat, endLonLat, 1);//调用高德计算距离 |
| | | if (null != distance) { |
| | |
| | | orderCrossCity.setServerCarModelId(orderCrossCityWarpper.getServerCarModelId()); |
| | | orderCrossCity.setDriverId(orderCrossCityWarpper.getDriverId()); |
| | | orderCrossCity.setLineId(orderCrossCityWarpper.getLineId()); |
| | | orderCrossCity.setLineDestinationId(orderCrossCityWarpper.getLineDestinationId()); |
| | | orderCrossCity.setLineShiftDriverId(orderCrossCityWarpper.getLineShiftDriverId()); |
| | | orderCrossCity.setCarId(orderCrossCityWarpper.getCarId()); |
| | | orderCrossCity.setOrderNum(this.getOrderNum(orderCrossCityWarpper.getDriverId(), orderCrossCityWarpper.getLineShiftDriverId())); |
| | |
| | | private Integer driverId; |
| | | @ApiModelProperty(value = "线路id", required = true, dataType = "int") |
| | | private Integer lineId; |
| | | @ApiModelProperty(value = "线路目的地id(t_line_destination.id)", required = false, dataType = "int") |
| | | private Integer lineDestinationId; |
| | | @ApiModelProperty(value = "车辆id", required = true, dataType = "int") |
| | | private Integer carId; |
| | | @ApiModelProperty(value = "下单地点经度", required = true, dataType = "double") |
| | |
| | | this.lineId = lineId; |
| | | } |
| | | |
| | | public Integer getLineDestinationId() { |
| | | return lineDestinationId; |
| | | } |
| | | |
| | | public void setLineDestinationId(Integer lineDestinationId) { |
| | | this.lineDestinationId = lineDestinationId; |
| | | } |
| | | |
| | | public Integer getCarId() { |
| | | return carId; |
| | | } |