| | |
| | | public Map<String, Object> queryOrderInfo(Integer orderId) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | OrderCrossCity orderCrossCity = this.selectById(orderId); |
| | | List<Map<String, Object>> order = orderCrossCityMapper.queryOrderInfo(orderCrossCity.getOrderNum()); |
| | | List<Map<String, Object>> order = orderCrossCityMapper.queryOrderInfo(orderCrossCity.getOrderNum(), orderCrossCity.getLineShiftDriverId()); |
| | | |
| | | int num = 0; |
| | | Double serverMoney = 0D; |
| | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("distance", distance); |
| | | Integer pricePeopleNumber = travelMode != null && travelMode == 2 && totalSeat != null && totalSeat > 0 ? totalSeat : peopleNumber; |
| | | |
| | | // 包车模式:使用线路包车价格 |
| | | if (travelMode != null && travelMode == 2) { |
| | | BigDecimal charterPrice = getLineCharterPrice(lineId, totalSeat); |
| | | map.put("price", charterPrice == null ? -1 : charterPrice.doubleValue()); |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | // 拼车模式:使用目的地单人价格 × 人数 |
| | | BigDecimal unitPrice = queryDefaultLineDestinationPrice(lineId, totalSeat); |
| | | map.put("price", unitPrice == null ? -1 : multiplyPeopleNumber(unitPrice, pricePeopleNumber).doubleValue()); |
| | | map.put("price", unitPrice == null ? -1 : multiplyPeopleNumber(unitPrice, peopleNumber).doubleValue()); |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | |
| | | if (destination == null) { |
| | | return null; |
| | | } |
| | | BigDecimal price = totalSeat != null && totalSeat == 6 |
| | | ? getBigDecimal(destination.get("price7")) |
| | | : getBigDecimal(destination.get("price5")); |
| | | BigDecimal price; |
| | | if (totalSeat != null && totalSeat == 7) { |
| | | price = getBigDecimal(destination.get("price7")); |
| | | } else if (totalSeat != null && totalSeat == 6) { |
| | | price = getBigDecimal(destination.get("price6")); |
| | | } else { |
| | | price = getBigDecimal(destination.get("price5")); |
| | | } |
| | | return price == null ? getBigDecimal(destination.get("price5")) : price; |
| | | } |
| | | |
| | |
| | | return price.multiply(new BigDecimal(peopleNumber)).setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | |
| | | /** |
| | | * 获取线路包车价格(根据座位数选择) |
| | | */ |
| | | private BigDecimal getLineCharterPrice(Integer lineId, Integer totalSeat) { |
| | | if (lineId == null || lineId <= 0) { |
| | | return null; |
| | | } |
| | | Map<String, Object> line = lineMapper.queryLineCharterPrices(lineId); |
| | | if (line == null) { |
| | | return null; |
| | | } |
| | | BigDecimal price; |
| | | if (totalSeat != null && totalSeat == 7) { |
| | | price = getBigDecimal(line.get("charterPrice7")); |
| | | } else if (totalSeat != null && totalSeat == 6) { |
| | | price = getBigDecimal(line.get("charterPrice6")); |
| | | } else { |
| | | price = getBigDecimal(line.get("charterPrice5")); |
| | | } |
| | | // 如果选择的价格为空,回退到5座价格 |
| | | return price == null ? getBigDecimal(line.get("charterPrice5")) : price; |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderCrossCity> taskMidAxbUnBindSend() throws Exception { |
| | | return this.baseMapper.taskMidAxbUnBindSend(); |